]> git.ipfire.org Git - thirdparty/ulogd2.git/log
thirdparty/ulogd2.git
13 years agooutput: XML: support for NFACCT input plugin
Pablo Neira Ayuso [Fri, 22 Jun 2012 14:55:41 +0000 (16:55 +0200)] 
output: XML: support for NFACCT input plugin

This patch extends XML plugin to support NFACCT. You can use
the following line in ulogd.conf to test it:

stack=acct1:NFACCT,xml1:XML

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
13 years agosrc: add ULOGD_DTYPE_SUM for nfacct-based accounting
Pablo Neira Ayuso [Fri, 22 Jun 2012 14:40:24 +0000 (16:40 +0200)] 
src: add ULOGD_DTYPE_SUM for nfacct-based accounting

This new type will be used in flow-up patch to support XML output.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
13 years agobuild: require 1.0.0 of all libraries ulogd-2.0.0
Pablo Neira Ayuso [Sun, 17 Jun 2012 11:02:30 +0000 (13:02 +0200)] 
build: require 1.0.0 of all libraries

Bump library version requirement to relatively recent releases of
all libraries (ie. 1.0.0 release).

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
13 years agobuild: bump release version to 2.0.0
Pablo Neira Ayuso [Sun, 17 Jun 2012 11:00:02 +0000 (13:00 +0200)] 
build: bump release version to 2.0.0

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
13 years agodoc: add documentation for SIGUSR2
Björn Lässig [Fri, 25 May 2012 12:36:42 +0000 (14:36 +0200)] 
doc: add documentation for SIGUSR2

Signal SIGUSR2 makes plugin ulogd_inpflow_NFCT to
 * dump conntrack table
 * flush counters

Signed-off-by: Björn Lässig <laessig@bitformer.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
13 years agopcap: resolve unreliable detection
Jan Engelhardt [Tue, 5 Jun 2012 08:37:19 +0000 (10:37 +0200)] 
pcap: resolve unreliable detection

pcap is not found reliably by either --with-pcap=%_prefix or
--with-pcap-lib=%_libdir --with-pcap-inc=%_includedir.

If you have any special paths, just use
./configure CPPFLAGS="-I/my/pcap" LDFLAGS="-L/my/pcap"

(And -lpcap is already known so no need to specify that.)

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
13 years agonfacct: resolve build failure
Jan Engelhardt [Tue, 5 Jun 2012 08:36:24 +0000 (10:36 +0200)] 
nfacct: resolve build failure

  CC       ulogd_inpflow_NFACCT_la-ulogd_inpflow_NFACCT.lo
ulogd_inpflow_NFACCT.c:24:27: fatal error: libmnl/libmnl.h:
No such file or directory
compilation terminated.

LIBS is not interchangeable with C(PP)FLAGS.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
13 years agosqlite: resolve compiler warnings
Jan Engelhardt [Tue, 5 Jun 2012 08:34:56 +0000 (10:34 +0200)] 
sqlite: resolve compiler warnings

In file included from /usr/include/string.h:642:0,
                 from ulogd_output_SQLITE3.c:34:
In function 'strncat',
    inlined from 'db_count_cols' at ulogd_output_SQLITE3.c:306:9,
    inlined from 'sqlite3_init_db' at ulogd_output_SQLITE3.c:328:11:
/usr/include/bits/string3.h:152:3: warning: call to __builtin___strncat_chk might overflow destination buffer [enabled by default]

I: Statement might be overflowing a buffer in strncat. Common mistake:
   BAD: strncat(buffer,charptr,sizeof(buffer)) is wrong, it takes the left over size as 3rd argument
   GOOD: strncat(buffer,charptr,sizeof(buffer)-strlen(buffer)-1)
E: ulogd2 bufferoverflowstrncat ulogd_output_SQLITE3.c:328:11

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
13 years agobuild: use pkglibdir instead of pkglibexecdir for automake
Björn Lässig [Sat, 10 Mar 2012 14:34:42 +0000 (14:34 +0000)] 
build: use pkglibdir instead of pkglibexecdir for automake

This fixes the following problem while running `autoreconf -fi`

`pkglibexecdir' is not a legitimate directory for `LTLIBRARIES'
variable `ulogd_filter_PRINTPKT_la_SOURCES' is defined but no program or
library has `ulogd_filter_PRINTPKT_la' as canonical name (possible typo)

Signed-off-by: Björn Lässig <laessig@bitformer.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
13 years agoNFCT: add `reliable' config option to enable reliable flow-based logging
Pablo Neira Ayuso [Mon, 5 Mar 2012 22:57:44 +0000 (23:57 +0100)] 
NFCT: add `reliable' config option to enable reliable flow-based logging

Reliability comes at the cost of dropping new flows if the
destroy event that ctnetlink delivers to us is lost. Under
heavy stress this may imply dropping packets, you've been
warned.

If you do want not to lose one single flow-logging information,
enable this.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
13 years agoulogd2 / DBI / table name
Harald Welte [Sun, 12 Feb 2012 22:56:27 +0000 (23:56 +0100)] 
ulogd2 / DBI / table name

DBI: allow to define table name via table config option

While using the DBI plugin of ulogd2 for NFCT based accounting, despite
using table="conntrack", it always insisted in using the table "ulog"
for deriving the keys/columns to be stored.

I've hacked up a quick fix, and it seems to work as expected (though no
proper null termination after strncpy).

Signed-off-by: Harald Welte <laforge@netfilter.org>
13 years agosrc: add example use of GPRINT to ulogd.conf.in configuration file
Pablo Neira Ayuso [Wed, 22 Feb 2012 12:07:22 +0000 (13:07 +0100)] 
src: add example use of GPRINT to ulogd.conf.in configuration file

Example on how this display one conntrack:

timestamp=2012/02/22-13:16:54,orig.ip.saddr=192.168.1.129,orig.ip.daddr=173.194.34.235,orig.ip.protocol=6,orig.l4.sport=58221,orig.l4.dport=80,orig.raw.pktlen=1206,orig.raw.pktcount=4,reply.ip.saddr=173.194.34.235,reply.ip.daddr=192.168.1.129,reply.ip.protocol=6,reply.l4.sport=80,reply.l4.dport=58221,reply.raw.pktlen=1104,reply.raw.pktcount=3,ct.mark=0,ct.id=846180008,ct.event=4,flow.end.sec=1329913014,flow.end.usec=413771,oob.family=2,oob.protocol=0

and one NFLOG line look like this

timestamp=2012/02/22-13:21:24,raw.pktlen=40,raw.pktcount=1,oob.prefix=test,oob.time.sec=1329913284,oob.time.usec=226795,oob.mark=0,oob.ifindex_in=3,oob.hook=1,raw.mac_len=14,oob.family=2,oob.protocol=2048,raw.label=0,raw.type=1,raw.mac.addrlen=6

People that like parsing comma-separated key-value files will
like this.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
13 years agoinput: add nfacct plugin
Pablo Neira Ayuso [Tue, 21 Feb 2012 19:07:00 +0000 (20:07 +0100)] 
input: add nfacct plugin

This patch adds the nfacct plugin.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
13 years agooutput: add GPRINT plugin
Pablo Neira Ayuso [Wed, 22 Feb 2012 11:33:51 +0000 (12:33 +0100)] 
output: add GPRINT plugin

This patch adds GPRINT which is a generalization of OPRINT.

It display the set of key-values separated by commas. This is
the generic print that you can attach to whatever kind of
input plugin.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
13 years agoOPRINT: display u64 fields
Pablo Neira Ayuso [Wed, 22 Feb 2012 11:16:13 +0000 (12:16 +0100)] 
OPRINT: display u64 fields

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
13 years agoulogd: add okey_set_u64
Pablo Neira Ayuso [Wed, 22 Feb 2012 11:14:09 +0000 (12:14 +0100)] 
ulogd: add okey_set_u64

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
13 years agoA simple filter plugin called IP2HBIN added
Jozsef Kadlecsik [Sun, 15 Jan 2012 14:48:13 +0000 (15:48 +0100)] 
A simple filter plugin called IP2HBIN added

The plugin converts the IPv4 addresses to host order for databases
like MySQL. The expected name of the table fields are ip.hsaddr,
ip.hdaddr, etc.

Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
13 years agoSupport stored mysql procedures besides stored functions
Jozsef Kadlecsik [Sun, 15 Jan 2012 12:16:01 +0000 (13:16 +0100)] 
Support stored mysql procedures besides stored functions

MySQL stored procedures must be invoked by the "CALL" SQL command and
not by "SELECT". Add the convention that if the procedure name starts
with "CALL", then the issued SQL command is "CALL procedurename(args)".

The stored procedure support in MySQL automatically brings transaction
support too.

Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
13 years agobuild: disable implicit .tar.gz archive generation and use POSIX mode
Jan Engelhardt [Sat, 17 Dec 2011 15:34:03 +0000 (16:34 +0100)] 
build: disable implicit .tar.gz archive generation and use POSIX mode

13 years agobuild: use AC_CONFIG_AUX_DIR and stash away tools
Jan Engelhardt [Sat, 17 Dec 2011 15:33:45 +0000 (16:33 +0100)] 
build: use AC_CONFIG_AUX_DIR and stash away tools

13 years agoUpdate .gitignore
Jan Engelhardt [Sat, 17 Dec 2011 15:32:43 +0000 (16:32 +0100)] 
Update .gitignore

Only ignore these paths if they are a directory.

13 years agopcap: add file option to configuration file
Eric Leblond [Thu, 1 Sep 2011 15:09:16 +0000 (17:09 +0200)] 
pcap: add file option to configuration file

Signed-off-by: Eric Leblond <eric@regit.org>
Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
13 years agopcap: fix build on some recent x86_64 platform
Eric Leblond [Thu, 1 Sep 2011 15:07:46 +0000 (17:07 +0200)] 
pcap: fix build on some recent x86_64 platform

Signed-off-by: Eric Leblond <eric@regit.org>
Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
14 years agobuild: abort autogen on subcommand failure
Jan Engelhardt [Mon, 1 Aug 2011 19:24:49 +0000 (21:24 +0200)] 
build: abort autogen on subcommand failure

Needed to stop an automated build process when automake requirements
are not fulfilled.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agoulogd: fix segfault if syslog and SIGTERM is received
Salih Gonullu [Sat, 26 Mar 2011 20:51:28 +0000 (21:51 +0100)] 
ulogd: fix segfault if syslog and SIGTERM is received

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
14 years agobuild: Linux kernel-style for compilation messages
Pablo Neira Ayuso [Tue, 15 Mar 2011 17:26:47 +0000 (18:26 +0100)] 
build: Linux kernel-style for compilation messages

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
14 years agosqlite3: remove automatic creation of table `daily'
Pablo Neira Ayuso [Fri, 25 Feb 2011 17:05:59 +0000 (18:05 +0100)] 
sqlite3: remove automatic creation of table `daily'

This patch removes the creation of the `daily' table. Now, we assume
that the table that we use are created before launching ulogd2.

This code is broken because you have to specify in the configuration
file that the table used is `daily', otherwise this `daily' table is
created and dropped during the daemon starting, but not used.

Moreover, the code explicit shows a message that it says:

/* FIXME make this configurable */

So, I think that this patch is the way to go :-).

This patch also documents the table creation in ulogd.sgml

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
14 years agosqlite3: fix warning during compilation
Pablo Neira Ayuso [Fri, 25 Feb 2011 17:48:32 +0000 (18:48 +0100)] 
sqlite3: fix warning during compilation

This patch fixes the following warning during the compilation:

ulogd_output_SQLITE3.c: In function ‘ulogd_find_key’:
ulogd_output_SQLITE3.c:292: warning: comparison between signed and unsigned integer expressions

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
14 years agosqlite3: cleanup error handling of sqlite3_bind_int() in sqlite3_interp()
Pablo Neira Ayuso [Fri, 25 Feb 2011 17:36:49 +0000 (18:36 +0100)] 
sqlite3: cleanup error handling of sqlite3_bind_int() in sqlite3_interp()

Move error handling after the switch statement since it's the same
for all cases, we save several lines of code.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
14 years agosqlite3: use continue instead of goto in sqlite3_interp()
Pablo Neira Ayuso [Fri, 25 Feb 2011 17:40:30 +0000 (18:40 +0100)] 
sqlite3: use continue instead of goto in sqlite3_interp()

Use continue instead of goto inside loop. I don't need to scroll
up and down in the code to know what the jump is performing.
I think this improve code readability. It's a comestic cleanup,
of course.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
14 years agoNFLOG: don't display overrun message once we have reach the buffer limit
Pablo Neira Ayuso [Fri, 25 Feb 2011 13:40:21 +0000 (14:40 +0100)] 
NFLOG: don't display overrun message once we have reach the buffer limit

We only report the overrun once with this patch, instead of spamming
the ulogd.log file.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
14 years agobuild: simplify sqlite3 check
Jan Engelhardt [Fri, 25 Feb 2011 13:06:52 +0000 (14:06 +0100)] 
build: simplify sqlite3 check

With pkg-config variables, even a non-installed sqlite3 can be
configured easily.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
14 years agoNFCT: use nfct_copy() instead of deprecated nfct_sizeof() function
Pablo Neira Ayuso [Fri, 25 Feb 2011 13:10:24 +0000 (14:10 +0100)] 
NFCT: use nfct_copy() instead of deprecated nfct_sizeof() function

nfct_sizeof() allows memcpy() of ct objects, which violates the
library design (that aims to hide binary layout).

We use nfct_copy() with the override flag instead as added by
libnetfilter_conntrack 0.9.1.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
14 years agosqlite3: add configuration examples and new tables layout
Pablo Neira Ayuso [Fri, 25 Feb 2011 12:06:20 +0000 (13:06 +0100)] 
sqlite3: add configuration examples and new tables layout

This patch adds two configuration examples for sqlite3 to log
flows and packets.

We use two tables, one for packet logging information, and
another for flow-based information.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
14 years agosqlite3: initial support extracted from Holger Eitzenberger's work
Pablo Neira Ayuso [Thu, 24 Feb 2011 20:45:41 +0000 (21:45 +0100)] 
sqlite3: initial support extracted from Holger Eitzenberger's work

This patch imports the sqlite3 support from Holger.

I applied folded the following patches, that Harald passed to me
during the last Netfilter workshop, into one:

0001-ulog2-sqlite-port-to-v2.diff.patch
0002-ulog2-sqlite-prepare-fix.diff.patch
0003-ulogd-sqlite-new-logging.diff.patch
0004-ulogd-accounting-add-flow-start-day.patch
0005-ulogd-sqlite3-err-codes-fix.dif.patch
0006-ulogd-sqlite3-tbl-corrupt-fix.diff.patch
0007-ulogd-sqlite3-handle-schema-change.diff.patch
0008-SQLITE3-count-instead-of-log-table-busy-messags.patch
0009-ulogd-SQLITE-Added-flowstartsec.diff.patch

Harald passed them to me with no description, so applying them
separately does not provide more information.

I'll start adding patches on top on these so Holger can get in
sync with my work. This also can help him to take my patches
and to integrate them to his tree.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
14 years agoconfig: add file option for NACCT pluging to the example config file
Pablo Neira Ayuso [Thu, 24 Feb 2011 19:30:01 +0000 (20:30 +0100)] 
config: add file option for NACCT pluging to the example config file

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
14 years agobuild: use compile/link information from pkgconfig
Jan Engelhardt [Tue, 1 Feb 2011 01:56:49 +0000 (02:56 +0100)] 
build: use compile/link information from pkgconfig

This is important for when the libraries are in a non-default path.
Also, libs must be listed in LDADD/LIBADD, not LDFLAGS.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agobuild: use appropriate location for program modules
Jan Engelhardt [Tue, 1 Feb 2011 01:37:18 +0000 (02:37 +0100)] 
build: use appropriate location for program modules

Modules - since they are dependent on the executable - generally go to
libexec/.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agobuild: avoid use of LIBS variable
Jan Engelhardt [Tue, 1 Feb 2011 01:41:27 +0000 (02:41 +0100)] 
build: avoid use of LIBS variable

The variable contains global libraries linked into every possible
object, which is unwanted. Clean up things.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agoulogd: fix double call of stop for reused input plugins
Pablo Neira Ayuso [Fri, 7 Jan 2011 12:19:25 +0000 (13:19 +0100)] 
ulogd: fix double call of stop for reused input plugins

This patch adds reference counting for plugins. This is used to fix
a double stop for input plugins that are reused.

This problem was reported by Salih Gonullu <sag@open.ch>:

http://marc.info/?l=netfilter&m=129439584700693&w=2

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
14 years agoNFCT: fix bug in polling mode
Pablo Neira Ayuso [Thu, 9 Dec 2010 11:02:15 +0000 (12:02 +0100)] 
NFCT: fix bug in polling mode

This closes the following bug:
http://bugzilla.netfilter.org/show_bug.cgi?id=684

This problem was introduced with the XML output plugin.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
14 years agofilter/HWHDR: remove redundant sizeof(char)
Jan Engelhardt [Fri, 5 Nov 2010 18:33:40 +0000 (19:33 +0100)] 
filter/HWHDR: remove redundant sizeof(char)

It is 1 by definition.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agobuild: no need for error message in PKG_CHECK_MODULES
Jan Engelhardt [Fri, 5 Nov 2010 18:28:15 +0000 (19:28 +0100)] 
build: no need for error message in PKG_CHECK_MODULES

PKG_CHECK_MODULES already produces its own (and more verbose) messsage
when a module cannot be found.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agobuild: propagate global CFLAGS
Jan Engelhardt [Fri, 5 Nov 2010 18:25:16 +0000 (19:25 +0100)] 
build: propagate global CFLAGS

We must not override CFLAGS, because that will break when the user
overrides CFLAGS again at make time (which he is entitled to). So,
name our CFLAGS regular_CFLAGS, and also include that across all
Makefiles so that they are actually uesd for all the code.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agobuild: default to not building static libraries
Jan Engelhardt [Fri, 5 Nov 2010 18:20:34 +0000 (19:20 +0100)] 
build: default to not building static libraries

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agooutput/LOGEMU: resolve build warning
Jan Engelhardt [Fri, 5 Nov 2010 18:19:14 +0000 (19:19 +0100)] 
output/LOGEMU: resolve build warning

ulogd_output_LOGEMU.c:37:2: warning: #warning this libc does not
define HOST_NAME_MAX

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agobuild: remove unused $(all_includes)
Jan Engelhardt [Fri, 5 Nov 2010 18:12:53 +0000 (19:12 +0100)] 
build: remove unused $(all_includes)

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agobuild: remove -fPIC flag
Jan Engelhardt [Fri, 5 Nov 2010 18:05:05 +0000 (19:05 +0100)] 
build: remove -fPIC flag

libtool automatically adds PIC flags as needed.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agobuild: remove statements without obvious effect
Jan Engelhardt [Fri, 5 Nov 2010 18:04:13 +0000 (19:04 +0100)] 
build: remove statements without obvious effect

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agobuild: move global automake options into configure.ac
Jan Engelhardt [Fri, 5 Nov 2010 18:03:28 +0000 (19:03 +0100)] 
build: move global automake options into configure.ac

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agoAdd helper script pcap2ulog
Pierre Chifflier [Wed, 20 Oct 2010 11:44:52 +0000 (13:44 +0200)] 
Add helper script pcap2ulog

This script uses the Net::Pcap Perl library to parse an pcap file and
send packets to ulogd2 throught the UNIXSOCK input module.

Signed-off-by: Pierre Chifflier <chifflier@edenwall.com>
14 years agoAdd new input plugin UNIXSOCK
Pierre Chifflier [Wed, 20 Oct 2010 11:44:51 +0000 (13:44 +0200)] 
Add new input plugin UNIXSOCK

This input plugins creates a unix socket which can be used to log packets.
Scripts or applications can connect to the socket (only one client allowed
per socket) and send data in a Key-Length-Value format (including the
payload).

Signed-off-by: Pierre Chifflier <chifflier@edenwall.com>
14 years agoDB output: fix crash in SIGHUP handling
Eric Leblond [Sun, 19 Sep 2010 17:55:41 +0000 (19:55 +0200)] 
DB output: fix crash in SIGHUP handling

This patch fixes the handling of SIGHUP when a SQL plugin is used. A
freed structure was previoulsy used to build the request and this was
leading to a crash.

14 years agoHWHDR: Fix various crashes
Eric Leblond [Sat, 18 Sep 2010 10:37:47 +0000 (12:37 +0200)] 
HWHDR: Fix various crashes

This patch fixes the HWHDR plugin. The logic of the interaction with
exiting plugin was not correctly coded and this was leading to crashes
due to the lack of sanity check.

14 years agoautoconf: fix sqlite configure description message.
Eric Leblond [Mon, 14 Dec 2009 19:24:35 +0000 (20:24 +0100)] 
autoconf: fix sqlite configure description message.

This patch fixes configure message as pointed out by
http://bugzilla.netfilter.org/show_bug.cgi?id=594

14 years agoulogd.conf: fix mysql definition for NFCT
Eric Leblond [Tue, 21 Sep 2010 23:23:26 +0000 (01:23 +0200)] 
ulogd.conf: fix mysql definition for NFCT

Mysql definition for NFCT usage was not correct.

14 years agoMysql schema: fix procedure declaration
Eric Leblond [Tue, 21 Sep 2010 22:37:20 +0000 (00:37 +0200)] 
Mysql schema: fix procedure declaration

It seems that some version of MySQL were more delicate about comment
in procedure. THis patch fixes a problem with a procedure comment
and fix the inner code which was not using the correct variable.

14 years agoMysql schema: fix delimiter
Eric Leblond [Tue, 21 Sep 2010 22:29:28 +0000 (00:29 +0200)] 
Mysql schema: fix delimiter

The use of delimiter was not correct in the MySQL schema. This patch
fixes this issue my correctly switching from ";" to "$$" when needed.

Based on a patch by Bruno Friedmann <bruno@ioda-net.ch>

14 years agopcap: fix packet length handling
Jan Andres [Mon, 6 Sep 2010 10:47:46 +0000 (12:47 +0200)] 
pcap: fix packet length handling

Currently, the PCAP output plugin uses ip.totlen to determine both the
"len" and "caplen" pcap header fields, as well as the amount of packet
data written to the file. There are two issues with this:

- For obvious reasons it doesn't work for IPv6.

- AFAICT, in case of an incompletely captured packet (--nflog-range)
  it will attempt to write out the whole packet, not just the part
  captured.

This patch changes the behavior to:

- Use raw.pktlen to set the "caplen" field, and the amount of data
  written.

- Determine the "len" (original length) field from ip.totlen or
  ip6.payload_len if possible, default to the same value as "caplen"
  otherwise.

Signed-off-by: Jan Andres <jandres@gmx.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
15 years agobuild: remove obsolete reference to debian/ dir in Makefile ulogd-2.0.0beta4
Pablo Neira Ayuso [Fri, 16 Jul 2010 15:53:01 +0000 (17:53 +0200)] 
build: remove obsolete reference to debian/ dir in Makefile

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
15 years agobuild: bump version to 2.0.0beta4 and update dependencies
Pablo Neira Ayuso [Fri, 16 Jul 2010 15:49:04 +0000 (17:49 +0200)] 
build: bump version to 2.0.0beta4 and update dependencies

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
15 years agoIPFIX: remove plugin until it is usable
Pablo Neira Ayuso [Thu, 17 Jun 2010 15:07:38 +0000 (17:07 +0200)] 
IPFIX: remove plugin until it is usable

This patch removes the IPFIX from the Makefile. Thus, we keep
it in the tree in the hope that we'll have time to finish it
in the future but don't compile it. This confuses users since
they think that it works.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
15 years agoNFCT: copy the conntrack object to the plugin once
Pablo Neira Ayuso [Thu, 17 Jun 2010 14:38:23 +0000 (16:38 +0200)] 
NFCT: copy the conntrack object to the plugin once

With this patch, we copy the conntrack object that we propagate
to the output plugin instances *only once*.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
15 years agofix wrong list addition in plugin re-use logic
Pablo Neira Ayuso [Thu, 17 Jun 2010 14:27:37 +0000 (16:27 +0200)] 
fix wrong list addition in plugin re-use logic

This patch fixes a bug that makes ulogd loops forever while
propagating inputs to the output plugin. It is reproducible
if you re-use three or more plugin instances. The problem is
that the parameters in the list addition are in incorrect
order.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
15 years agoNFCT: fix plugin re-use in different stacks
Pablo Neira Ayuso [Thu, 17 Jun 2010 13:20:57 +0000 (15:20 +0200)] 
NFCT: fix plugin re-use in different stacks

This patch fixes a problem in configurations that use the NFCT
plugin as input in several stacks. The first plugin loaded contains
the hashtable and other important NFCT private data. Other plugin
instances of NFCT are dummies that are only used to store the
output keys.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
15 years agooutput: XML: add infix in output file
Pablo Neira Ayuso [Thu, 17 Jun 2010 11:50:30 +0000 (13:50 +0200)] 
output: XML: add infix in output file

This patch adds an infix to the XML file to avoid problems if we are
logging packets and flows at the same time. Thus, we create two
different XML files whose filename describes the sort of logging
information that it contains. It is also useful when listing files
at a quick sight.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
15 years agooutput: XML: support reopening file via SIGHUP
Pablo Neira Ayuso [Thu, 17 Jun 2010 11:04:26 +0000 (13:04 +0200)] 
output: XML: support reopening file via SIGHUP

This feature is useful for log-rotation.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
15 years agooutput: add new plugin XML to output logs in XML
Pablo Neira Ayuso [Sun, 17 Jan 2010 21:34:06 +0000 (22:34 +0100)] 
output: add new plugin XML to output logs in XML

This patch adds XML that allows to log information in XML for
ulogd2. It supports packet and flow-based accounting.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
15 years agofix incorrect negative EINTR checking in main loop
Pablo Neira Ayuso [Sun, 13 Jun 2010 19:03:16 +0000 (21:03 +0200)] 
fix incorrect negative EINTR checking in main loop

This patch fixes the following error that is displayed if we send
SIGHUP to reopen the logfile:

ulogd.c:904 select says Interrupted system call

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
15 years agoLOGEMU: fix crash if output file cannot be accessed
Pablo Neira Ayuso [Thu, 3 Jun 2010 12:56:19 +0000 (14:56 +0200)] 
LOGEMU: fix crash if output file cannot be accessed

This patch fixes a crash if the output file was not correctly opened.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
15 years agosrc: use ARRAY_SIZE to calculate the array size of keys
Pablo Neira Ayuso [Tue, 26 Jan 2010 12:10:40 +0000 (13:10 +0100)] 
src: use ARRAY_SIZE to calculate the array size of keys

This patch is a cleanup to use ARRAY_SIZE in NFLOG and ULOG input
plugins.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
15 years agoIP2BIN: fix missing protocol key
Christophe Fish [Fri, 2 Apr 2010 12:16:54 +0000 (14:16 +0200)] 
IP2BIN: fix missing protocol key

ulogd2 from git won't start using filter IP2BIN. It gives the following error
message in the log:

<1> ulogd.c:670 traversing plugin `IP2BIN'
<1> ulogd.c:627 log4(NFLOG)
<1> ulogd.c:733 assigning `oob.family(?)' as source for IP2BIN(oob.family)
<7> ulogd.c:727 cannot find key `' in stack
<1> ulogd.c:863 destroying stack

Filling up ip2bin_inp[] declaration with missing section in
filter/ulogd_filter_IP2BIN.c solves the problem:

Signed-off-by: Christophe Fish <christophe.fish@free.fr>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
15 years agoNFCT: fix reset counters via SIGUSR2 signal
Pablo Neira Ayuso [Wed, 13 Jan 2010 10:39:18 +0000 (11:39 +0100)] 
NFCT: fix reset counters via SIGUSR2 signal

This patch fixes a feature that allows to force the logging of
the existing entries and reset the counters.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
15 years agoNFCT: fix number of options (missing one)
Pablo Neira Ayuso [Tue, 12 Jan 2010 15:31:00 +0000 (16:31 +0100)] 
NFCT: fix number of options (missing one)

This patch fixes the number of options in NFCT that is
actually 8, not 7.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
15 years agoNFCT: split event handler if hashtable is used or not
Pablo Neira Ayuso [Tue, 12 Jan 2010 15:21:50 +0000 (16:21 +0100)] 
NFCT: split event handler if hashtable is used or not

This patch splits event_handler into two functions:
event_handler_hashtable and event_handler_no_hashtable.
Thus, we register the appropriate handler during the
initialization time. This patch is a cleanup.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
15 years agoNFCT: use new hashtable implementation for better performance
Pablo Neira Ayuso [Mon, 11 Jan 2010 18:15:49 +0000 (19:15 +0100)] 
NFCT: use new hashtable implementation for better performance

This patch replaces the existing hashtable implementation with
a newer that provide better performance since it reduces the
number of hash computations.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
15 years agoNFCT: change `pollinterval' behaviour
Pablo Neira Ayuso [Mon, 11 Jan 2010 16:38:22 +0000 (17:38 +0100)] 
NFCT: change `pollinterval' behaviour

This patch adds support for poll-based logging. Basically,
ulogd polls from the kernel periodically to log entries. You
can use the `pollinterval' option in the configuration file to
set the polling period.

This patch changes the current behaviour of `pollinterval'
that allowed to mix both the event-driven logging with
polling periodically from the kernel. I have tried to look
for anyone in google (and asking Eric Leblond) using this
feature but I found noone.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
15 years agoNFCT: cleanup constructor and destructor functions
Pablo Neira Ayuso [Sun, 10 Jan 2010 20:39:48 +0000 (21:39 +0100)] 
NFCT: cleanup constructor and destructor functions

This patch cleans up the destructor and the destructor functions
in the NFCT plugin. I know, this patch isn't easy to review
because it includes too many changes in one.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
15 years agoFix wrong definition of views in flat DB schema
Pierre Chifflier [Thu, 17 Sep 2009 19:28:20 +0000 (21:28 +0200)] 
Fix wrong definition of views in flat DB schema

Create views using the ip_protocol field (and not the oob_family).

Signed-off-by: Pierre Chifflier <chifflier@inl.fr>
15 years agoRemove debian directory
Pierre Chifflier [Thu, 17 Sep 2009 19:28:19 +0000 (21:28 +0200)] 
Remove debian directory

Remove Debian packaging files, it is easier to maintain the packaging
files outside of the sources.

Signed-off-by: Pierre Chifflier <chifflier@inl.fr>
16 years agoIPFIX: preliminary fixes, yet unusable
Pablo Neira Ayuso [Wed, 29 Jul 2009 14:27:01 +0000 (16:27 +0200)] 
IPFIX: preliminary fixes, yet unusable

This patch is a preliminary fix for the yet-unfinished IPFIX
support. This patch resolves a couple of bugs that made ulogd
crash and a couple of missing symbols that didn't allow to
use this plugin in the configuration file.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
16 years agobuild: remove -lpthread from Makefile
Pablo Neira Ayuso [Wed, 22 Jul 2009 18:34:19 +0000 (20:34 +0200)] 
build: remove -lpthread from Makefile

This patch remove -lpthread that was introduced time ago to
workaround a problem in gdb.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
16 years agoNFCT: avoid spamming report about netlink overruns
Pablo Neira Ayuso [Wed, 22 Jul 2009 18:28:56 +0000 (20:28 +0200)] 
NFCT: avoid spamming report about netlink overruns

This patch reduces the verbosity of the log messages that report
netlink overruns.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
16 years agoNFCT: add configurable option to set the value of the resynchronization timer
Pablo Neira Ayuso [Wed, 22 Jul 2009 18:17:28 +0000 (20:17 +0200)] 
NFCT: add configurable option to set the value of the resynchronization timer

This patch adds `netlink_resync_timeout' that allows you to set
the number of seconds that we wait to perform a resynchronization
due to a netlink overrun. This patch changes the default timeout
from 2 to 60 seconds (less agressive).

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
16 years agoNFCT: improve netlink overrun handling
Pablo Neira Ayuso [Wed, 22 Jul 2009 17:36:26 +0000 (19:36 +0200)] 
NFCT: improve netlink overrun handling

With this patch, we schedule one resynchronization against the
kernel conntrack table that will occur in two seconds (still
we need a patch to make this configurable). Before this, we
scheduled a resynchronization for every overrun, that is very
bad in a scenario in which overruns occurs very frequently.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
16 years agoNFCT: fix NULL dereference when hashtable is full
Pablo Neira Ayuso [Tue, 23 Jun 2009 15:38:18 +0000 (17:38 +0200)] 
NFCT: fix NULL dereference when hashtable is full

This patch fixes a NULL dereference to the timestamp structure when
hashtable_add() fails, for example, because the hashtable is full.

Reported-by: Bernhard Schmidt <berni@birkenwald.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
16 years agoRevert "ulogd: permit compilation of plugin outside of tree"
Eric Leblond [Sat, 18 Apr 2009 11:58:26 +0000 (13:58 +0200)] 
Revert "ulogd: permit compilation of plugin outside of tree"

This reverts commit 0ff525cb0506b2c043bc9df6d7e7b486c865bc38. A stable
and clean API should be provided if we choose to offer for external
module capability.

16 years agoDocumentation: information about procedure variable.
Eric Leblond [Sat, 18 Apr 2009 11:38:27 +0000 (13:38 +0200)] 
Documentation: information about procedure variable.

This patch documents the "procedure" option in the database
plugin configurations.

16 years agoDB plugins: fixed bug with INSERT* procedures
Romain Bignon [Fri, 17 Apr 2009 12:56:19 +0000 (14:56 +0200)] 
DB plugins: fixed bug with INSERT* procedures

When procedure begins with INSERT* (without space), it considers it as an
INSERT statement.

Signed-off-by: Romain Bignon <romain@inl.fr>
16 years agoDB plugin: add capability to specify complete INSERT command
Eric Leblond [Thu, 16 Apr 2009 08:21:49 +0000 (10:21 +0200)] 
DB plugin: add capability to specify complete INSERT command

This patch modifies the procedure name parsing to be able to specify a
complete INSERT command.

16 years agoulogd: configure all plugins before resolving keys.
Pierre Chifflier [Thu, 16 Apr 2009 12:20:40 +0000 (14:20 +0200)] 
ulogd: configure all plugins before resolving keys.

Split the 'resolve keys' step in two parts: first call the configure
fonction for all plugins (in reverse order), then loop again
to resolve the keys.
This allows dynamic construction of the input and output keys, even
for filter plugins.

Signed-off-by: Pierre Chifflier <chifflier@inl.fr>
16 years agoulogd: permit compilation of plugin outside of tree
Eric Leblond [Sun, 5 Apr 2009 10:34:31 +0000 (12:34 +0200)] 
ulogd: permit compilation of plugin outside of tree

This patch modifies Makefile.am to install the headers needed for
compilation of plugins outside of the source tree.

16 years agoulogd: include config.h in all files.
Eric Leblond [Tue, 10 Mar 2009 06:43:30 +0000 (07:43 +0100)] 
ulogd: include config.h in all files.

This patch adds config.h inclusion in ulogd.h to be able to use all
defined value in the whole project.

16 years agodb plugins: free memory at exit.
Eric Leblond [Tue, 10 Mar 2009 06:37:38 +0000 (07:37 +0100)] 
db plugins: free memory at exit.

This patches frees an allocated buffer when ulogd is quitting.

16 years agoip2bin: add AF_BRIDGE family support.
Eric Leblond [Tue, 3 Mar 2009 20:22:33 +0000 (21:22 +0100)] 
ip2bin: add AF_BRIDGE family support.

This patch adds support for AF_BRIDGE family. It synchronizes code of
IP2BIN module with the one of IP2STR.

16 years agohwhdr: suppress explicit allocation
Eric Leblond [Mon, 2 Mar 2009 22:28:31 +0000 (23:28 +0100)] 
hwhdr: suppress explicit allocation

This patch suppresses all allocation and use a statically
created array instead.

16 years agoip2bin: suppress explicit allocation of some output key values
Eric Leblond [Mon, 2 Mar 2009 22:00:58 +0000 (23:00 +0100)] 
ip2bin: suppress explicit allocation of some output key values

This patch suppresses explicit allocation and free for each packet and use
a statically created array instead.

16 years agoip2str: suppress explicit allocation of some output key values
Eric Leblond [Mon, 2 Mar 2009 21:54:15 +0000 (22:54 +0100)] 
ip2str: suppress explicit allocation of some output key values

This patch suppresses explicit allocation and free for each packet
and use a statically created array instead.

16 years agoifindex: avoid memory allocation
Eric Leblond [Mon, 2 Mar 2009 21:40:09 +0000 (22:40 +0100)] 
ifindex: avoid memory allocation

This patch modifies the interp function to avoid to do an explicit
allocation of memory.

16 years agonflog: adjust unit which was inaccurate.
Eric Leblond [Mon, 9 Feb 2009 20:56:00 +0000 (21:56 +0100)] 
nflog: adjust unit which was inaccurate.

Timeout unit is 10ms and not 1ms. This patch fixes an invalid comment
in the configuration file.