Commit Graph

180 Commits (d0880d75ffff3152f3c60b2bab7ad89d525b5814)

Author SHA1 Message Date
Ken Steele bc29684df4 Remove GCC -no-strict-aliasing compiler flag.
GCC typically generates better code without the -no-strict-aliasing flag.
It is only required if code makes assumptiosn that break strict aliasing.
The unit tests pass on x86 and Tile without the flag.
11 years ago
Ken Steele f0c785cc1d Fix configuring Prelude with -Werror
Running with:

CFLAGS="-Werror" ./configure

would fail when configuring libprelude because of an unused-result
warning. Ignore that one warning.
11 years ago
Eric Leblond a75911e02f pfring: workaround potential librt deps
It seems some version of pfring needs to be link with librt.
11 years ago
Ken Steele 3d81e50ab3 Check for compiler for -march=native support
Check all compilers to see if they support the -march=native flags, rather
than assuming gcc 4.2 or later does. Tile GCC doesn't currently support it,
so not checking break Tile compiles.
11 years ago
Eric Leblond fcc8759561 util-ioctl: add GRO/LRO detection capabilities
This patch adds a new function GetIfaceOffloading which return 0
if LRO and GRO are not set on a interface and 1 if not the case.
11 years ago
Eric Leblond 64cd49da31 configure: accept libnet 1.1 and 1.2. 11 years ago
Victor Julien 0bfba8352d pcre: check for pcre_free_study, fall back to pcre_free if it unavailable 11 years ago
Victor Julien c8b71938ff Add a fallback memrchr implementation for those platforms that dont support it. Bug #963. 11 years ago
Eric Leblond daa9dcb75f Use wget or curl to download ruleset. 11 years ago
Victor Julien 900918a5d1 Bug #948: detect thread local storage support 11 years ago
Ken Steele 1bbbcf5120 Make the missing libhtp error message more clear.
Use exact git clone command and then rerun autogen.sh and configure.
11 years ago
Ken Steele 149d2a0793 Fix typo in configure.ac echo message 11 years ago
Anoop Saldanha f85a2dc84b fix for #875.
Update configure.ac to check for either 0.5.5 and 0.5.x version of libhtp.
11 years ago
Victor Julien 8060ef41af configure: add iconv.h check to configure if bundled libhtp is used 11 years ago
Victor Julien 83014adcfa Fix autogen on older systems 11 years ago
Eric Leblond 0cef0b8808 configure: minor cleaning 11 years ago
Eric Leblond 7dbc97b01c autotools: AM_INIT_AUTOMAKE with args is deprecated 11 years ago
Eric Leblond c099349550 configure: check for iconv in htp embedded mode
At least on freebsd, suricata fails to build in htp embedded mode
due to iconv linking issue.
11 years ago
Eric Leblond 0c37f76fa2 Check for local include first. 11 years ago
Victor Julien fdc3b5ba15 Fix CLS configure check 11 years ago
Anoop Saldanha 48cf0585fb Suricata upgrade to libhtp 0.5.x.
Remove the support for now unsupported personalities from libhtp -
TOMCAT_6_0, APACHE and APACHE_2_2.  We instead use the APACHE_2
personality.
11 years ago
Victor Julien 4749420f32 Use relative dir instead of ac_builddir
When generating src/build-info.h the use of ac_builddir was problematic.
There were several cases where it was undefined leading to the absolute
path /src/build-info.h. ./configure should be called from the parent dir
to the actual src dir, so this should work. Make distcheck and normal builds
complete fine.
11 years ago
Victor Julien aafc65c757 Autotools: move libhtp conditionals to configure
In preparation of the libhtp upgrade, move all libhtp related conditionals
to configure. This allows for one set of build scripts that works regardless
of the presence of a local libhtp dir.
11 years ago
Victor Julien 55625d738a TLS: create certs dir on 'make install-full'. Bug #711. 11 years ago
Anoop Saldanha 68847d12e3 Update configure.ac to use the default value of 64 for the cache line size
for systems which return a value of 0.
11 years ago
Ken Steele 3db717db6d Update configure.ac to detect Tile architecture.
Detect if the architecture supports the Tilera mPipe packet processing
hardware. It it does, add the requried libraries and define HAVE_MPIPE.
12 years ago
Victor Julien 71c22ddfee Move fallback to CLS detection to configure script. 12 years ago
Victor Julien 0ddd57cb05 Fix CLS detection on systems that have getconf, but don't support the LEVEL1_DCACHE_LINESIZE option. 12 years ago
Victor Julien 724ad9e8e7 Detect L1 cache line size at build time. Fall back to 64 bytes if detection failed. 12 years ago
Victor Julien b7c759fdf4 NFQ: fix configure check for finding out signed/unsigned args for nfq_get_payload 12 years ago
Florian Westphal 8da02115c9 nfq: add support for batch verdicts
Normally, there is one verdict per packet, i.e., we receive a packet,
process it, and then tell the kernel what to do with that packet (eg.
DROP or ACCEPT).

recv(), packet id x
send verdict v, packet id x
recv(), packet id x+1
send verdict v, packet id x+1
[..]
recv(), packet id x+n
send verdict v, packet id x+n

An alternative is to process several packets from the queue, and then send
a batch-verdict.

recv(), packet id x
recv(), packet id x+1
[..]
recv(), packet id x+n
send batch verdict v, packet id x+n

A batch verdict affects all previous packets (packet_id <= x+n),
we thus only need to remember the last packet_id seen.

Caveats:
- can't modify payload
- verdict is applied to all packets
- nfmark (if set) will be set for all packets
- increases latency (packets remain queued by the kernel
  until batch verdict is sent).

To solve this, we only defer verdict for up to 20 packets and
send pending batch-verdict immediately if:
- no packets are currently queue
- current packet should be dropped
- current packet has different nfmark
- payload of packet was modified

This patch adds a configurable batch verdict support for workers runmode.
The batch verdicts are turned off by default.

Problem is that batch verdicts only work with kernels >= 3.1, i.e.
using newer libnetfilter_queue with an old kernel means non-working
suricata. So the functionnality has to be disabled by default.
12 years ago
Eric Leblond 6913109bf3 configure: use correct syntax for help string 12 years ago
Eric Leblond 7d706563ef configure: add --enable-unix-socket flag
This new flag allows the user to force unix socket build or to
disallow it completely. Default which is test is maintained.
12 years ago
Eric Leblond 0470c0f678 jansson: change function test to be sure of version 12 years ago
Victor Julien 04d7d00df6 Try to use pkg-config to resolve libnspr and related dependencies. 12 years ago
Christian Kreibich cb8e5bc533 Try to use pkg-config to resolve libnss and related dependencies. 12 years ago
Victor Julien eeb439c1a3 Open 2.0 dev branch 12 years ago
Jason Ish eae4de9850 Replace the deprecated AM_CONFIG_HEADER with AC_CONFIG_HEADERS.
Addresses bug #704 for building on a Mac.  More generically
it addresses the issue building using newers versions of automake.
12 years ago
Eric Leblond cd305c3a78 suricatasc: update python packaging
'make install' install now suricatasc script and Python module to
the system. The suricatasc client module can now be used in other
Python projects by using 'import suricatasc'.

A transformation was needed for distribution of a module and a script.
Module in src directory is now containing most of the code and the
script only handle argument parsing and the creation of a unix socket
client through 'suricatasc' module.
12 years ago
Eric Leblond 6d225378e4 Workaround function missing in libhtp include
As reported in bug #688, htp_config_set_path_decode_u_encoding
function is not included in libhtp header before 0.3.0. Result
is that suricata compilation fail with an external htp library.
The following patch detect the issue and adds the missing
declaration.
12 years ago
Eric Leblond d472d606e9 configure: update htp version dependancy 12 years ago
Victor Julien cc51eec59d Use new libhtp query string normalization. Bug #739. 12 years ago
Eric Leblond 8d7b9703af 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 ago
Eric Leblond 84f50ba49f build-info: use printf instead of SCLogInfo
This change results in a more readable and reusable output.
12 years ago
Eric Leblond 668113af77 add configure summary to build-info output 12 years ago
Victor Julien 8f19024999 geoip: add Fedora pkg hint to configure check 12 years ago
Ignacio Sanchez d771e08156 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 ago
Victor Julien 467f28e98e clang: make atomics work 12 years ago
Eric Leblond 344ea3fa7c 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 ago
Victor Julien 0f42f0e890 Minor fixes 12 years ago
Eric Leblond ef45f7dac4 configure: fix indent 12 years ago
Eric Leblond 20a8b9dbe5 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 ago
Eric Leblond 819debdce5 configure: use pkg-config for luajit
If luajit includes or libs is not set in configure, we fallback to
pkg-config output.
12 years ago
Eric Leblond e125869d30 configure: exit if luajit header are not found but build ask 12 years ago
Victor Julien b63c2eda6a build: more cygwin cleanups 12 years ago
Victor Julien 8660877961 undo setting exact version in configure.ac 12 years ago
Eric Leblond 1c3546fec1 install: create state dir with install-conf 12 years ago
Victor Julien e2c7078cc3 Add contrib dir and it's content to the dist. Bug 567 12 years ago
Victor Julien 472e061c6d build: more checking for includes 12 years ago
Victor Julien 89f83c2ee4 configure formatting fixes 12 years ago
Victor Julien 042d0c6ee8 build cleanups 12 years ago
Matt Keeler 37e3de8425 Refactor Napatech 3GD to just Napatech as Suricata is only going to support 3GD.
Signed-off-by: Matt Keeler <mk@npulsetech.com>
12 years ago
Matt Keeler 5786a32d0f Remove Napatech 2GD support
Removed the Napatech 2GD support

runmode-napatech-3gd.c had an include from runmode-napatech.h which was erroneous and has been removed as well.

Signed-off-by: Matt Keeler <mk@npulsetech.com>
12 years ago
Eric Leblond a49bce63b0 configure: fix small typo. 12 years ago
Eric Leblond 37b05b2396 configure: improve march=native detection
clang is supposed to support march=native but if the CPU is too
recent for clang, this can cause an invalid detection of arch and
result in a incapability of clang to compile any binary.
This patch updates the test to try a compilation with march=native
when clang is the used compiler.
12 years ago
Eric Leblond 1f94239d20 configure: differentiate gcc and clang options
The version checking was made similarly for clang and gcc. This
patch modifies this to check on compiler name. This way we can
avoid to set march=native which is not supported by clang on
some system.
At the same time, this fix the annoying warning about no-fp-tree
being unsupported by clang.
12 years ago
Victor Julien 829238e49c OpenBSD 5.2 build fixes, Unit test fix. 12 years ago
Matt Keeler 844e4dba11 Napatech 3GD Support
For use with Network Cards from Napatech utilizing the 3GD driver/api.

    - Implemented new run modes in runmode-napatech-3gd.*
    - Implemented capture/decode threads in source-napatech-3gd.*
    - Integrated the new run modes and source into the build infrastructure.

    New configure switches
    --enabled-napatech-3gd : Turns on the NT 3GD support
    --with-napatech-3gd-includes : The directory containing the NT 3GD header files
    --with-napatech-3gd-libraries : The directory containing the NT 3GD libraries to link against.

    New CLI switch
    --napatech-3gd : Uses the Napatech 3GD run mode

    Runmodes Supported:
    - auto
    - autofp
    - workers

    Notes:
    - tested with 1 Gbps sustained traffic (no drops)

Signed-off-by: Matt Keeler <mk@npulsetech.com>
12 years ago
Eric Leblond 02874a16f5 gcc: construct use for warning was too recent. 12 years ago
Eric Leblond 2fbb28ece6 build: error on implicit function declaration
This patch modifies gcc options to error in case of implicit
declaration. Bug #612 has shown this kind of bugs can be very
costly.
12 years ago
Eric Leblond ac5bab8838 OpenBSD: no support for profiling
Local thread storage are not available so profiling is not supported.
12 years ago
Eric Leblond 7c85bee4aa OpenBSD: magic.mc path has changed in OpenBSD 5.1 12 years ago
Eric Leblond 58bf4ea4a4 nfq: fix detection of type nfq_get_payload function. 12 years ago
Eric Leblond ec2445702c autotools: fix default path for magic file. 12 years ago
Victor Julien c9cc137de5 Add --enable-luajit option to configure 12 years ago
Victor Julien 5b2fbfb123 luajit: tell build sys about it 12 years ago
Victor Julien 438dd61948 Update version number to reflect we're working towards 1.4 now. 12 years ago
Eric Leblond 2c57275921 nfq: implement "fail-open" support.
On linux >= 3.6, you can use the fail-open option on a NFQ queue
to have the kernel accept the packet if userspace is not able to keep
pace.

Please note that the kernel will not trigger an error if the feature is activated
in userspace libraries but not available in kernel.

This patch implements the option for suricata by adding a nfq.fail-open
configuration variable which is desactivated by default.
12 years ago
Eric Leblond adbf85c4a9 autotools: fix detection with clang
This patch improve detection of type of nfq_get_payload() by only
converting to error the warning we have when using the wrong type.
12 years ago
Eric Leblond e0ddcdd194 autotools: rename configure.in to configure.ac
configure.in is deprecated since long and will be replaced by
configure.ac. For more information, see:
  http://lists.gnu.org/archive/html/automake/2012-08/msg00023.html
12 years ago