]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
9 years agoapp-layer: scripts to setup app-layer templates 1634/head
Jason Ish [Tue, 1 Sep 2015 21:20:13 +0000 (15:20 -0600)] 
app-layer: scripts to setup app-layer templates

setup-app-layer.sh sets up an application layer detector and
parser template.

setup-app-layer-logger.sh sets up a JSON application layer
transaction logger for an application parser that has
already been provisioned.

setup-app-layer-detect.sh sets up a keyword for performing
content inspections on buffers created by the application
layer.

9 years agoapp-layer: template for application layer content inspection
Jason Ish [Tue, 1 Sep 2015 18:36:00 +0000 (12:36 -0600)] 
app-layer: template for application layer content inspection

9 years agoapp-layer: template for application layer tx logger
Jason Ish [Tue, 1 Sep 2015 18:12:28 +0000 (12:12 -0600)] 
app-layer: template for application layer tx logger

9 years agoapp-layer: template for application layer parser
Jason Ish [Tue, 1 Sep 2015 18:04:34 +0000 (12:04 -0600)] 
app-layer: template for application layer parser

9 years agodocker: add ASAN to pcaps build 1631/head
Eric Leblond [Wed, 9 Sep 2015 20:40:37 +0000 (22:40 +0200)] 
docker: add ASAN to pcaps build

9 years agodevelopment tools: add script to setup detect module 1625/head
Victor Julien [Fri, 28 Aug 2015 13:03:07 +0000 (15:03 +0200)] 
development tools: add script to setup detect module

Simplify creation of a new detect module by creating a copy of the
detect template. It sets the name and registers it in the build
system. Finally it's registration function is called.

9 years agodetect plugin: add template
Victor Julien [Fri, 30 Nov 2012 15:57:53 +0000 (16:57 +0100)] 
detect plugin: add template

9 years agodevelopment tools: add script to setup new decoder
Victor Julien [Thu, 27 Aug 2015 15:37:52 +0000 (17:37 +0200)] 
development tools: add script to setup new decoder

Simplify creation of a new decoder.

9 years agodecoder: add template/example
Victor Julien [Tue, 25 Aug 2015 16:08:55 +0000 (18:08 +0200)] 
decoder: add template/example

Add fictional example / template for a packet decoder. It's not invoked
anywhere.

9 years agolua: TLS support
Victor Julien [Thu, 9 Jul 2015 19:45:15 +0000 (21:45 +0200)] 
lua: TLS support

Support TLS in Lua detection scripts.

function init (args)
    local needs = {}
    needs["tls"] = tostring(true)
    return needs
end

function match(args)
    version, subject, issuer, fingerprint = TlsGetCertInfo();
    if version == nil then
        return 0
    end
    str = string.format("Version %s\nIssuer %s\nSubject %s\nFingerprint %s",
                        version, issuer, subject, fingerprint)
    SCLogInfo(str);
    return 1
end

9 years agodetect-lua: set direction
Victor Julien [Thu, 9 Jul 2015 19:44:38 +0000 (21:44 +0200)] 
detect-lua: set direction

9 years agolua: add direction support
Victor Julien [Thu, 9 Jul 2015 19:42:38 +0000 (21:42 +0200)] 
lua: add direction support

9 years agoDNS: refactor tx completion logic 1623/head
Victor Julien [Wed, 2 Sep 2015 11:07:59 +0000 (13:07 +0200)] 
DNS: refactor tx completion logic

Use simple bool values to track the transaction state in both directions.

A tx is only created in two cases:
1. full request parsed
2. response parsed (request missing)

This is true even for multi-packet TCP requests.

This leads to the following tx completion logic for the request side:
the presence of a tx implies the request is complete

On the response side, we consider the tx complete when we have seen
the response. If the DNS parser thinks the response was lost, we also
flag the response side as complete.

9 years agoyaml: add missing ippair section 1619/head
Victor Julien [Mon, 31 Aug 2015 16:05:17 +0000 (18:05 +0200)] 
yaml: add missing ippair section

9 years agoaf-packet: don't activate rollover by default
Eric Leblond [Sat, 29 Aug 2015 08:49:26 +0000 (10:49 +0200)] 
af-packet: don't activate rollover by default

Rollover option is causing issue with TCP streaming code because
packets from the same flow to be treated out of order. As long as
the situation is not fixed in the streaming engine, it is a bad idea
to enable it by default.

9 years agoFix minor format string issues
Victor Julien [Fri, 21 Aug 2015 07:48:42 +0000 (09:48 +0200)] 
Fix minor format string issues

9 years agoautotools: cleanup
Victor Julien [Thu, 20 Aug 2015 11:37:09 +0000 (13:37 +0200)] 
autotools: cleanup

Remove most of the CFLAGS updates from configure. Flags are now (mostly)
set in AM_CLFLAGS.

Update all -DBLAH additions to CFLAGS to use AC_DEFINE([BLAH], ...)

Improve Lua vs LuaJIT checking.

Improve the configure output a bit.

Lots of smaller cleanups.

9 years agosource-pfring: don't set cluster mode when using ZC and VLAN tracking is disabled 1613/head
Antti Tönkyrä [Sat, 15 Aug 2015 20:58:56 +0000 (20:58 +0000)] 
source-pfring: don't set cluster mode when using ZC and VLAN tracking is disabled

9 years agonetmap: enable zero-copy mode only when copy-mode is specified.
gureedo [Tue, 28 Jul 2015 04:40:13 +0000 (09:40 +0500)] 
netmap: enable zero-copy mode only when copy-mode is specified.
Perform zero-copy checks only when copy-mode is specified.

9 years agonetmap: extended comments for options in configuration file.
gureedo [Tue, 28 Jul 2015 04:35:53 +0000 (09:35 +0500)] 
netmap: extended comments for options in configuration file.
Added extended description of the use of OS endpoint with copy mode.

9 years agotransaction inspection: fix limit enforcement
Victor Julien [Thu, 20 Aug 2015 17:31:23 +0000 (19:31 +0200)] 
transaction inspection: fix limit enforcement

Make sure we're never wrapping around the size value.

10 years agoAllow colon in SSH version, at least some trojaned PuTTY clients have version like... 1608/head
Antti Tönkyrä [Tue, 19 May 2015 20:07:21 +0000 (20:07 +0000)] 
Allow colon in SSH version, at least some trojaned PuTTY clients have version like Putty-Local: Timestamp HH:MM:SS

10 years agoxff: support ports and more ipv6 notations
Victor Julien [Tue, 21 Jul 2015 15:27:26 +0000 (17:27 +0200)] 
xff: support ports and more ipv6 notations

It's not uncommon to see an header like:
X-Forwarded-For: 1.2.3.4:56789

This patch recognizes this case and ignores the port. It also supports
this for IPv6 if the address has the following notation:
X-Forwarded-For: [12::34]:1234

This patch also adds unittests.

10 years agodetect loader: move to own file
Victor Julien [Mon, 20 Jul 2015 17:55:38 +0000 (19:55 +0200)] 
detect loader: move to own file

10 years agodetect-loaders: configurable amount of loaders
Victor Julien [Mon, 20 Jul 2015 16:08:37 +0000 (18:08 +0200)] 
detect-loaders: configurable amount of loaders

10 years agodebug: packet pool init/destroy validation
Victor Julien [Wed, 22 Apr 2015 10:41:57 +0000 (12:41 +0200)] 
debug: packet pool init/destroy validation

Validate packet pool handling:
- pools are initialized before use
- pools are not used after destroy
- pools are not double initialized/destroyed

10 years agounittests: use a global packetpool
Victor Julien [Wed, 8 Jul 2015 13:57:26 +0000 (15:57 +0200)] 
unittests: use a global packetpool

10 years agomulti-detect: improve memory handling of setup code
Victor Julien [Tue, 19 May 2015 13:14:49 +0000 (15:14 +0200)] 
multi-detect: improve memory handling of setup code

10 years agomulti-detect: detect loader for unix socket
Victor Julien [Wed, 13 May 2015 13:35:47 +0000 (15:35 +0200)] 
multi-detect: detect loader for unix socket

Move the tenant load and reload commands to be executed by the detect
loader thread(s).

Limitation: no yaml parsing in parallel. The Conf API is currently not
thread safe, so don't load the tenant config (yaml) in parallel.

10 years agodetect: create loader threads
Victor Julien [Tue, 12 May 2015 09:35:47 +0000 (11:35 +0200)] 
detect: create loader threads

To speed up startup with many tenants, tenant loading will be parallelized.
As no tempary threads should be used for these memory allocation heavy
tasks, this patch adds new type of 'command' thread that can be used to
load and reload tenants.

This patch hardcodes the number of loaders to 4. Future work will make it
dynamic.

The loader thread essentially sleeps constantly. When a tasks is sent to
it, it will wake up and execute it.

10 years agomulti-detect: set tenant id on pseudo packets
Victor Julien [Mon, 13 Apr 2015 08:33:11 +0000 (10:33 +0200)] 
multi-detect: set tenant id on pseudo packets

Store the tenant id in the flow and use the stored id when setting
up pesudo packets.

For tunnel and defrag packets, get tenant from parent. This will only
pass tenant_id's set at capture time.

For defrag packets, the tenant selector based on vlan id will still
work as the vlan id(s) are stored in the defrag tracker before being
passed on.

10 years agomulti-detect: hash lookup for tenants
Victor Julien [Thu, 9 Apr 2015 16:20:28 +0000 (18:20 +0200)] 
multi-detect: hash lookup for tenants

Use hash for storing and looking up det_ctxs.

10 years agodetect: clean up thread free code
Victor Julien [Fri, 10 Apr 2015 07:59:33 +0000 (09:59 +0200)] 
detect: clean up thread free code

Introduce DetectEngineThreadCtxFree that doesn't need a 'ThreadVars'
pointer.

10 years agomulti-detect: make threshold prefix aware
Victor Julien [Wed, 8 Apr 2015 13:59:46 +0000 (15:59 +0200)] 
multi-detect: make threshold prefix aware

Make threshold loading prefix aware, so it can be part of tenant
configuration.

If the setting is missing from the tenant, the global setting is tried
and if that too is missing, the global default is used.

Note: currently per host thresholds are tracked globally and NOT per
tenant.

10 years agomulti-detect: make reference prefix aware
Victor Julien [Wed, 8 Apr 2015 13:31:52 +0000 (15:31 +0200)] 
multi-detect: make reference prefix aware

Make reference loading prefix aware, so it can be part of tenant
configuration.

If the setting is missing from the tenant, the global setting is tried
and if that too is missing, the global default is used.

10 years agomulti-detect: make classification prefix aware
Victor Julien [Wed, 8 Apr 2015 12:55:16 +0000 (14:55 +0200)] 
multi-detect: make classification prefix aware

Make classification loading prefix aware, so it can be part of tenant
configuration.

If the setting is missing from the tenant, the global setting is tried
and if that too is missing, the global default is used.

10 years agomulti-detect: implement reload tenant in suricatasc
Victor Julien [Sat, 14 Mar 2015 19:27:30 +0000 (20:27 +0100)] 
multi-detect: implement reload tenant in suricatasc

10 years agomulti-detect: add reload-tenant command
Victor Julien [Sat, 14 Mar 2015 19:23:13 +0000 (20:23 +0100)] 
multi-detect: add reload-tenant command

Allow for a tenant to be reloaded. The command is the same as the
register-tenant command, so with a yaml and tenant-id as argument.
However this replaces an existing tenant.

10 years agomulti-detect: add tenant id to alert json output
Victor Julien [Sun, 1 Mar 2015 09:34:53 +0000 (10:34 +0100)] 
multi-detect: add tenant id to alert json output

Add a integer field "tenant_id" to the JSON alert output.

10 years agomulti-detect: store tenant id in packet
Victor Julien [Sun, 1 Mar 2015 09:09:21 +0000 (10:09 +0100)] 
multi-detect: store tenant id in packet

Store tenant id in the packet so that the output API's can log it.

10 years agomulti-detect: refuse to add duplicate tenant
Victor Julien [Fri, 20 Feb 2015 09:40:32 +0000 (10:40 +0100)] 
multi-detect: refuse to add duplicate tenant

Generate error if tentant to be added is already loaded.

10 years agomulti-detect: cleanup, reuse tenant loading code
Victor Julien [Fri, 20 Feb 2015 08:33:53 +0000 (09:33 +0100)] 
multi-detect: cleanup, reuse tenant loading code

Reuse tenant loading from YAML code for Unix Socket.

10 years agomulti-detect: load tenants from yaml file
Victor Julien [Thu, 19 Feb 2015 17:45:10 +0000 (18:45 +0100)] 
multi-detect: load tenants from yaml file

Load tenants and mappings from the suricata.yaml when available.

10 years agosuricatasc: add unregister-tenant-handler
Victor Julien [Thu, 12 Feb 2015 14:30:20 +0000 (15:30 +0100)] 
suricatasc: add unregister-tenant-handler

10 years agosuricatasc: add register-tenant-handler command
Victor Julien [Fri, 6 Feb 2015 14:08:44 +0000 (15:08 +0100)] 
suricatasc: add register-tenant-handler command

Arguments:
- tenant id (int)
- name of handler (string)
- traffic id related to handler (int, optional)

Examples:
- register-tenant-handler 1 vlan 1111
- register-tenant-handler 8 pcap

10 years agomulti-detect: implement unregister-tenant-handler
Victor Julien [Thu, 12 Feb 2015 14:56:38 +0000 (15:56 +0100)] 
multi-detect: implement unregister-tenant-handler

Remove a tenant handler from the list and apply it.

10 years agodetect: don't error out on no de_ctx
Victor Julien [Thu, 12 Feb 2015 13:13:46 +0000 (14:13 +0100)] 
detect: don't error out on no de_ctx

This can happen on a multi-detect setup with no registered
engines yet.

10 years agomulti-detect: set selector from yaml
Victor Julien [Thu, 12 Feb 2015 11:39:27 +0000 (12:39 +0100)] 
multi-detect: set selector from yaml

Yaml setting is: multi-detect.selector

Implement 'vlan' and 'direct'.

10 years agomulti-detect: error on start if no selector registered
Victor Julien [Thu, 12 Feb 2015 11:08:33 +0000 (12:08 +0100)] 
multi-detect: error on start if no selector registered

Force user to select the method at startup.

10 years agomulti-detect: register counters on 'master' det_ctx
Victor Julien [Thu, 12 Feb 2015 13:14:35 +0000 (14:14 +0100)] 
multi-detect: register counters on 'master' det_ctx

Otherwise counters are only registered after the stats api is
already fixed.

10 years agomulti-detect: allow start up with 0 tenants
Victor Julien [Thu, 12 Feb 2015 10:04:35 +0000 (11:04 +0100)] 
multi-detect: allow start up with 0 tenants

10 years agounix-socket: implement register-tenant-handler
Victor Julien [Fri, 6 Feb 2015 15:01:09 +0000 (16:01 +0100)] 
unix-socket: implement register-tenant-handler

Register tenant handlers/selectors based on what the unix command
"register-tenant-handler" tells.

Check traffic id before adding it. No duplicated registrations for
a traffic id are allowed.

10 years agomulti-detect: initial selectors for tenants
Victor Julien [Thu, 5 Feb 2015 17:58:26 +0000 (18:58 +0100)] 
multi-detect: initial selectors for tenants

The Detection Thread has the TenantGetId pointer which allows it
to select a tenant id based on the packet.

10 years agodetect: select detect engine at Detect entry
Victor Julien [Fri, 30 Jan 2015 14:04:38 +0000 (15:04 +0100)] 
detect: select detect engine at Detect entry

Limited to Pcap only currently.

10 years agounix-socket: allow tenant id with pcap-file
Victor Julien [Fri, 30 Jan 2015 13:27:05 +0000 (14:27 +0100)] 
unix-socket: allow tenant id with pcap-file

Register the tenant id that the pcap-file optionally got.

10 years agopcap-file: set tenant-id if available
Victor Julien [Fri, 30 Jan 2015 12:20:12 +0000 (13:20 +0100)] 
pcap-file: set tenant-id if available

Set the id to each packet's 'pcap_v' structure.

10 years agosuricatasc: allow for tenant id in pcap-file
Victor Julien [Fri, 30 Jan 2015 12:03:13 +0000 (13:03 +0100)] 
suricatasc: allow for tenant id in pcap-file

Allow for an optional 'tenant id' argument to pcap-file. This will
allow us to force the pcap to be inspected by this tenant.

If ommited it's 0, which means it's disabled.

10 years agodetect: use multi tenant thread init if MT enabled
Victor Julien [Thu, 29 Jan 2015 15:40:23 +0000 (16:40 +0100)] 
detect: use multi tenant thread init if MT enabled

10 years agodetect: make multi tenancy a global switch
Victor Julien [Thu, 29 Jan 2015 13:39:01 +0000 (14:39 +0100)] 
detect: make multi tenancy a global switch

At start up we will set this flag based on "multi-detect.enabled".

10 years agotenants: apply added/removed tenant
Victor Julien [Thu, 29 Jan 2015 10:33:11 +0000 (11:33 +0100)] 
tenants: apply added/removed tenant

Apply to the engine.

10 years agodetect: initial MT lookup logic
Victor Julien [Thu, 29 Jan 2015 10:20:09 +0000 (11:20 +0100)] 
detect: initial MT lookup logic

In the DetectEngineThreadCtx, store another DetectEngineThreadCtx per
tenant.

Currently it's just a simple array indexed by the tenant id.

10 years agomulti-detect: (un)register-tenant unix socket commands
Victor Julien [Mon, 12 Jan 2015 18:00:16 +0000 (19:00 +0100)] 
multi-detect: (un)register-tenant unix socket commands

Make available to live mode and unix socket mode.

register-tenant:
    Loads a new YAML, does basic validation.
    Loads a new detection engine
    Loads rules
    Add new de_ctx to master store and stores tenant id in the de_ctx so
        we can look it up by tenant id later.

unregister-tenant:
    Gets the de_ctx, moves it to the freelist
    Removes config

Introduce DetectEngineGetByTenantId, which gets a reference to the
detect engine by tenant id.

10 years agoeve alert: fix stream payload printing 1607/head
Victor Julien [Wed, 22 Jul 2015 14:33:56 +0000 (16:33 +0200)] 
eve alert: fix stream payload printing

10 years agodetect: fix pass transaction handling
Victor Julien [Fri, 17 Jul 2015 19:05:14 +0000 (21:05 +0200)] 
detect: fix pass transaction handling

If a flow was 'pass'd, it means that no packet of it will flow be handled
by the detection engine. A side effect of this was that the per flow
inspect_id would never be moved forward. This in turn lead to a situation
where transactions wouldn't be freed.

This patch addresses this case by incrementing the inspect_id anyway for
the pass case.

10 years agodetect: set flow noinspect on pass in applayer/stream
Victor Julien [Fri, 17 Jul 2015 15:49:01 +0000 (17:49 +0200)] 
detect: set flow noinspect on pass in applayer/stream

If a pass rule matches in the reassembled stream and/or in the
app-layer state, it means the rest of the flow should not be
inspected.

10 years agohttp: destroy htp_tx_t even if incomplete
Victor Julien [Fri, 17 Jul 2015 13:31:56 +0000 (15:31 +0200)] 
http: destroy htp_tx_t even if incomplete

10 years agodetect: make http prefilter use disrupt flags
Victor Julien [Fri, 17 Jul 2015 11:38:36 +0000 (13:38 +0200)] 
detect: make http prefilter use disrupt flags

10 years agodetect: optimize http prefilter handing
Victor Julien [Fri, 17 Jul 2015 11:37:46 +0000 (13:37 +0200)] 
detect: optimize http prefilter handing

10 years agodetect: pass flags to inspect_id update logic
Victor Julien [Fri, 17 Jul 2015 11:32:31 +0000 (13:32 +0200)] 
detect: pass flags to inspect_id update logic

10 years agooutput-tx: use disrupt flags
Victor Julien [Fri, 17 Jul 2015 11:10:15 +0000 (13:10 +0200)] 
output-tx: use disrupt flags

10 years agoapp-layer: pass full flags around in tx handling
Victor Julien [Fri, 17 Jul 2015 11:09:37 +0000 (13:09 +0200)] 
app-layer: pass full flags around in tx handling

10 years agoapp-layer: disruption flags
Victor Julien [Thu, 16 Jul 2015 14:43:19 +0000 (16:43 +0200)] 
app-layer: disruption flags

Stream GAPs and stream reassembly depth are tracked per direction. In
many cases they will happen in one direction, but not in the other.

Example:
HTTP requests a generally smaller than responses. So on the response
side we may hit the depth limit, but not on the request side.

The asynchronious 'disruption' has a side effect in the transaction
engine. The 'progress' tracking would never mark such transactions
as complete, and thus some inspection and logging wouldn't happen
until the very last moment: when EOF's are passed around.

Especially in proxy environments with _very_ many transactions in a
single TCP connection, this could lead to serious resource issues. The
EOF handling would suddenly have to handle thousands or more
transactions. These transactions would have been stored for a long time.

This patch introduces the concept of disruption flags. Flags passed to
the tx progress logic that are and indication of disruptions in the
traffic or the traffic handling. The idea is that the progress is
marked as complete on disruption, even if a tx is not complete. This
allows the detection and logging engines to process the tx after which
it can be cleaned up.

10 years agodetect: clean up flag usage
Victor Julien [Thu, 16 Jul 2015 13:35:19 +0000 (15:35 +0200)] 
detect: clean up flag usage

10 years agodetect: constify some DetectMpmPrefilter args
Victor Julien [Thu, 16 Jul 2015 13:35:01 +0000 (15:35 +0200)] 
detect: constify some DetectMpmPrefilter args

10 years agodns: fix state progress handling
Victor Julien [Wed, 15 Jul 2015 11:58:12 +0000 (13:58 +0200)] 
dns: fix state progress handling

10 years agoapp-layer: fix args to state progress calls
Victor Julien [Wed, 15 Jul 2015 11:08:22 +0000 (13:08 +0200)] 
app-layer: fix args to state progress calls

10 years agoSync alversion/appversion types
Victor Julien [Wed, 15 Jul 2015 07:53:39 +0000 (09:53 +0200)] 
Sync alversion/appversion types

The app layer state 'version' field is incremented with each update
to the state. It is used by the detection engine to see if the current
version of the state has already been inspected. Since app layer and
detect always run closely together there is no need for a big number
here. The detect code really only checks for equal/not-equal, so wrap
arounds are not an issue.

10 years agohttp: harden tx inspection code
Victor Julien [Tue, 14 Jul 2015 18:09:36 +0000 (20:09 +0200)] 
http: harden tx inspection code

10 years agoflow/stream: xfer noinspect flags to pseudo pkts
Victor Julien [Thu, 16 Jul 2015 10:49:38 +0000 (12:49 +0200)] 
flow/stream: xfer noinspect flags to pseudo pkts

Set noinspection flags for payloads and packets on flow and stream
pseudo packets. Without these, the pseudo packets could trigger
inspection even though this was disabled for a flow.

10 years agodetect: optimize Signature layout
Victor Julien [Thu, 16 Jul 2015 09:22:04 +0000 (11:22 +0200)] 
detect: optimize Signature layout

10 years agodetect: default to u32 for SigIntId
Victor Julien [Thu, 16 Jul 2015 09:21:44 +0000 (11:21 +0200)] 
detect: default to u32 for SigIntId

10 years agofile-json: add file_id to message
Eric Leblond [Wed, 27 May 2015 12:01:36 +0000 (14:01 +0200)] 
file-json: add file_id to message

This will allow to get the filename and by consequence the file
after a parsing of the EVEV log file.

10 years agoaf-packet: implement rollover option
Eric Leblond [Fri, 19 Jun 2015 10:13:31 +0000 (12:13 +0200)] 
af-packet: implement rollover option

This patch implements the rollover option in af_packet capture.
This should heavily minimize the packet drops as well as the
maximum bandwidth treated for a single flow.

The option has been deactivated by default but it is activated in
the af_packet default section. This ensure there is no change for
old users using an existing YAML. And new users will benefit from
the change.

This option is available since Linux 3.10. An analysis of af_packet
kernel code shows that setting the flag in all cases should not
cause any trouble for older kernel.

10 years agoaf-packet: implement new load balancing modes
Eric Leblond [Fri, 19 Jun 2015 10:08:53 +0000 (12:08 +0200)] 
af-packet: implement new load balancing modes

This patch implements the fanout load balancing modes available
in kernel 4.0. The more interesting is cluster_qm that does the
load balancing based on the RSS queues. So if the network card
is doing a flow based load balancing then a given socket will
receive all packets of a flow indepently of the CPU affinity.

10 years agoaf-packet: sync header with latest features
Eric Leblond [Fri, 19 Jun 2015 10:05:05 +0000 (12:05 +0200)] 
af-packet: sync header with latest features

Sync the replacement define with the latest Linux code.
This patch also updates the detection part in configure.ac
to do a declaration of all fields if the newest features are
not present.

10 years agonetmap: support SW rings
Aleksey Katargin [Thu, 16 Jul 2015 16:17:49 +0000 (21:17 +0500)] 
netmap: support SW rings
Netmap uses SW rings to send and receive packets from OS.

10 years agonetmap: strict check for zero copy mode
Aleksey Katargin [Thu, 16 Jul 2015 13:51:03 +0000 (18:51 +0500)] 
netmap: strict check for zero copy mode
Netmap does not guarantees that mmap'ed regions for different interfaces would be the same.

10 years agonetmap: fixed autofp mode.
Aleksey Katargin [Thu, 16 Jul 2015 13:35:23 +0000 (18:35 +0500)] 
netmap: fixed autofp mode.
Previous implementation does not work with this mode.

10 years agonetmap: support non-equal count of Rx and Tx rings on interface.
Aleksey Katargin [Thu, 16 Jul 2015 12:43:28 +0000 (17:43 +0500)] 
netmap: support non-equal count of Rx and Tx rings on interface.
Netmap does not guarantees that NIC will have equal number of transmit and receive rings.

10 years agoUse unlikely for error treatment in alert-prelude.c 1601/head
Schnaffon [Tue, 28 Apr 2015 10:23:12 +0000 (12:23 +0200)] 
Use unlikely for error treatment in alert-prelude.c

When handling error cases on creation of a new idmef field, we are in an unlikely case. This patch adds the unlikely() expression to indicate this to gcc.

10 years agointroduce fatal error macro's 1600/head
Victor Julien [Fri, 10 Jul 2015 10:19:57 +0000 (12:19 +0200)] 
introduce fatal error macro's

Add 'FatalError' and 'FatalErrorConditonal' that will take the same
args as SCLogError.

FatalError logs the error using SCLogError and then exits with return
code EXIT_FAILURE.

FatalErrorOnInit does the same only during init and with
--init-errors-fatal enabled, otherwise it just calls SCLogWarning. So
then the macro returns to the caller.

Implement this for output setup.

10 years agolua: dns support
Victor Julien [Wed, 10 Jun 2015 10:15:10 +0000 (12:15 +0200)] 
lua: dns support

10 years agodns: generic inspect engines for DNS
Victor Julien [Wed, 10 Jun 2015 09:57:59 +0000 (11:57 +0200)] 
dns: generic inspect engines for DNS

10 years agodetect: add AppLayerTxMatch call
Victor Julien [Wed, 10 Jun 2015 09:50:51 +0000 (11:50 +0200)] 
detect: add AppLayerTxMatch call

10 years agodns: generic request/response detect lists
Victor Julien [Tue, 9 Jun 2015 13:31:32 +0000 (15:31 +0200)] 
dns: generic request/response detect lists

10 years agodns: rename type so it's purpose is more clear
Victor Julien [Tue, 9 Jun 2015 12:49:22 +0000 (14:49 +0200)] 
dns: rename type so it's purpose is more clear

10 years agolua: dns extensions
Victor Julien [Fri, 5 Jun 2015 06:53:47 +0000 (08:53 +0200)] 
lua: dns extensions

Add DNS lua calls for getting queries, answers, authorities. Also
rcode and recusion desired flags.

10 years agolua: initial DNS logging support
Victor Julien [Thu, 4 Jun 2015 08:46:26 +0000 (10:46 +0200)] 
lua: initial DNS logging support

10 years agotls-store: avoid log flooding
Eric Leblond [Wed, 15 Jul 2015 20:21:07 +0000 (22:21 +0200)] 
tls-store: avoid log flooding

In case we can't write in the certs directory, this is possible
we flood the log for each TLS session or even worse each TLS
packet.  So this patch puts a limit in the number of logged
messages related to file creation.

10 years agofilestore: use SCFree instead of free
Eric Leblond [Wed, 15 Jul 2015 11:50:22 +0000 (13:50 +0200)] 
filestore: use SCFree instead of free