]> git.ipfire.org Git - thirdparty/ulogd2.git/log
thirdparty/ulogd2.git
15 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>

15 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>
16 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>
16 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.

16 years agobuild: bump version to 2.00beta3 ulogd-2.0.0beta3
Pablo Neira Ayuso [Fri, 6 Mar 2009 17:56:34 +0000 (18:56 +0100)] 
build: bump version to 2.00beta3

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
16 years agoDelete timer in destructor function.
Eric Leblond [Wed, 14 Jan 2009 22:08:38 +0000 (23:08 +0100)] 
Delete timer in destructor function.

This patch deletes the overrun timer in the destructor function.

16 years agopgsql: fix type of mac_protocol and oob_protocol.
Eric Leblond [Mon, 2 Feb 2009 19:46:32 +0000 (20:46 +0100)] 
pgsql: fix type of mac_protocol and oob_protocol.

The oob_protocol does not fit into a smallint (IPv6 case for example).
This patch switches the length of the related field to an integer.

16 years agoAdd threshold and timeout option to NFLOG plugin.
Eric Leblond [Tue, 27 Jan 2009 23:16:39 +0000 (00:16 +0100)] 
Add threshold and timeout option to NFLOG plugin.

This patch adds support for setting NFLOG threshold and timeout
from ulogd.

16 years agoExplicitely type PCAP input key.
Eric Leblond [Tue, 27 Jan 2009 11:02:15 +0000 (12:02 +0100)] 
Explicitely type PCAP input key.

This patch affect type and flag to PCAP input key.

16 years agoDisplay which keys are optional in info mode.
Eric Leblond [Tue, 27 Jan 2009 10:21:54 +0000 (11:21 +0100)] 
Display which keys are optional in info mode.

This patch adds a "optional" keyword to description of input key which are
optional when --info is used to dump information about a plugin.

16 years agoReplace INCLUDES by AM_CPPFLAGS in Makefile.am.
Eric Leblond [Thu, 22 Jan 2009 13:11:14 +0000 (14:11 +0100)] 
Replace INCLUDES by AM_CPPFLAGS in Makefile.am.

This patch fixes autotools warning about deprecated usage of INCLUDES in
Makefile.am.

16 years agobuild: update configure.ac
Jan Engelhardt [Tue, 20 Jan 2009 11:08:06 +0000 (12:08 +0100)] 
build: update configure.ac

Some constructs in there are old-fashioned. Replace them by their
modern counterparts.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agobuild: resolve autotools suggestions to use AC_CONFIG_MACRO_DIR
Jan Engelhardt [Tue, 20 Jan 2009 11:05:54 +0000 (12:05 +0100)] 
build: resolve autotools suggestions to use AC_CONFIG_MACRO_DIR

libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and
libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agobuild: use -avoid-version for modules
Jan Engelhardt [Tue, 20 Jan 2009 08:04:03 +0000 (09:04 +0100)] 
build: use -avoid-version for modules

The modules are pretty much bound to ulogd, and it does not seem
to make sense to specially version these.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agoUpdate .gitignore and remove install-sh
Jan Engelhardt [Tue, 20 Jan 2009 08:00:53 +0000 (09:00 +0100)] 
Update .gitignore and remove install-sh

install-sh is autogenerated.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agobuild: compile fix
Jan Engelhardt [Sun, 18 Jan 2009 17:50:04 +0000 (18:50 +0100)] 
build: compile fix

ulogd_inpflow_NFCT.c: In function 'propagate_ct':
ulogd_inpflow_NFCT.c:483: error: 'IPPROTO_UDPLITE' undeclared (first use in this function)

(and more for IPPROTO_SCTP)

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agoHWHDR: Fix size of allocated string.
Eric Leblond [Tue, 13 Jan 2009 00:00:46 +0000 (01:00 +0100)] 
HWHDR: Fix size of allocated string.

This patch fixes a incorrect computing of the allocation size
of a string.

16 years agoFix crash on IPv6 packet.
Eric Leblond [Mon, 12 Jan 2009 23:57:10 +0000 (00:57 +0100)] 
Fix crash on IPv6 packet.

Incorrect definition of a IPv6 input key handling function was causing
a crash in ulogd.

16 years agoDisplay logfile to check in case of error.
Eric Leblond [Mon, 12 Jan 2009 23:13:25 +0000 (00:13 +0100)] 
Display logfile to check in case of error.

This patch adds the display of the used logging file to look at if there
is a critical error.

16 years agofix config file: MAC2STR has been renamed to HWHDR.
Eric Leblond [Mon, 12 Jan 2009 22:56:12 +0000 (23:56 +0100)] 
fix config file: MAC2STR has been renamed to HWHDR.

This patch replaces all MAC2STR occurences by HWHDR to sync with the
renaming of the plugin.

16 years agoFlat SQL schema for MySQL
Pierre Chifflier [Tue, 6 Jan 2009 22:31:17 +0000 (23:31 +0100)] 
Flat SQL schema for MySQL

This schema is designed for performance, by putting all fields in a
single table. It should be used in combination with plain INSERT.

Signed-off-by: Pierre Chifflier <chifflier@inl.fr>
16 years agoFlat SQL schema for PostgreSQL
Pierre Chifflier [Tue, 6 Jan 2009 22:31:16 +0000 (23:31 +0100)] 
Flat SQL schema for PostgreSQL

This schema is designed for performance, by putting all fields in a
single table. It should be used in combination with plain INSERT.

Signed-off-by: Pierre Chifflier <chifflier@inl.fr>
16 years agoPostgreSQL: allow local connections
Pierre Chifflier [Tue, 6 Jan 2009 22:31:13 +0000 (23:31 +0100)] 
PostgreSQL: allow local connections

This patch allows to connect to the server using the local (unix) socket,
thus not using a network socket and SSL encryption.
Local connection is used if host parameter is omitted or empty.

Signed-off-by: Pierre Chifflier <chifflier@inl.fr>
16 years agoDBI: lower column name before comparing to key
Pierre Chifflier [Tue, 6 Jan 2009 22:31:18 +0000 (23:31 +0100)] 
DBI: lower column name before comparing to key

Some databases (e.g Oracle) return column name in uppercase, while
key name is in lowercase. This patch allows to match keys correctly.

Signed-off-by: Pierre Chifflier <chifflier@inl.fr>
16 years agoAllow plain INSERT instead of procedure
Pierre Chifflier [Tue, 6 Jan 2009 22:31:14 +0000 (23:31 +0100)] 
Allow plain INSERT instead of procedure

If the procedure name specified in configuration is INSERT, than use
a regular insertion instead of a stored procedure.
This should be used when performance is needed, with a flat SQL schema,
to reduce the cost of SQL procedure calls.

Signed-off-by: Pierre Chifflier <chifflier@inl.fr>
16 years agoPostgreSQL schema: drop useless constraints
Pierre Chifflier [Tue, 6 Jan 2009 22:31:15 +0000 (23:31 +0100)] 
PostgreSQL schema: drop useless constraints

Constraints on TCP/UDP port number validity are useless and only slow
down insertions.

Signed-off-by: Pierre Chifflier <chifflier@inl.fr>
16 years agoAdd variable to force binding of nfnetlink_log.
Eric Leblond [Sun, 4 Jan 2009 22:29:50 +0000 (23:29 +0100)] 
Add variable to force binding of nfnetlink_log.

This patch updates the behaviour of the NFLOG input plugin to fix an
issue related to kernel older than 2.6.29. The call to nflog_bind_pf()
that can be necessary to receive packet from the nfnetlink_log was only
done if the used group was 0 (system logging). This is logic for the
newest kernel (NFLOG really sends message to nfnetlink_log and not to
the nf_log logger). But this is unsufficient for older one. By forcing
the binding with the new configuration variable bind, it is now possible
to trigger the binding from the ulogd2 configuration file. This gives
users a way to be sure that ulogd will receive packets if the NFLOG
input plugin is used.

16 years agoReturn true/false instead of ULOGD_IRET_OK/STOP
Thomas Jacob [Mon, 8 Dec 2008 18:27:06 +0000 (19:27 +0100)] 
Return true/false instead of ULOGD_IRET_OK/STOP

Signed-off-by: Thomas Jacob <jacob@internet24.de>
Signed-off-by: Eric Leblond <eric@inl.fr>
16 years agoAdd valgrind compilation option.
Eric Leblond [Sun, 30 Nov 2008 20:06:46 +0000 (21:06 +0100)] 
Add valgrind compilation option.

Valgrind messages are obscur when the plugins are unloaded. This patch
adds a macro that can be used to desactivate unloading. To use it, you
have to specify 'CPPFLAGS=-DDEBUG_VALGRIND' on configure line.

16 years agoFix memory leak in destructor_nfct().
Eric Leblond [Sun, 30 Nov 2008 16:15:04 +0000 (17:15 +0100)] 
Fix memory leak in destructor_nfct().

This patch fixes a memory leak in the destructor function which was not
releasing the memory allocated for each connection tracking entry.

16 years agoFree stacks when exiting.
Eric Leblond [Sun, 30 Nov 2008 15:54:57 +0000 (16:54 +0100)] 
Free stacks when exiting.

This patch modifies ulogd2 to have it free the stacks when leaving.

16 years agoIntroduce config_stop() function
Eric Leblond [Sun, 30 Nov 2008 15:49:54 +0000 (16:49 +0100)] 
Introduce config_stop() function

This patch adds the config_stop function which is in charge of releasing
ressources allocated for configuration file parsing.

16 years agoUnload plugins when quitting.
Eric Leblond [Sun, 30 Nov 2008 15:41:55 +0000 (16:41 +0100)] 
Unload plugins when quitting.

This patch adds unloading of plugins (call dlclose()) in ulogd2. This
make valgrind happy and will be useful for daemon live reconfiguration.

16 years agoAdd SIGINT to list of terminal signal.
Eric Leblond [Sun, 30 Nov 2008 10:22:19 +0000 (11:22 +0100)] 
Add SIGINT to list of terminal signal.

This patch modifies ulogd to intercept SIGINT signal
and quit nicely when this signal is received.

16 years agoCall pluginstance stop function when exiting
Eric Leblond [Sat, 29 Nov 2008 23:58:00 +0000 (00:58 +0100)] 
Call pluginstance stop function when exiting

The stop function of plugin was not called when ulogd2 was
preparing to quit. This patch adds a call to stop for all
plugins in each stack and free pluginstance.

16 years agoFix minor memory leak in NFLOG plugin.
Eric Leblond [Sat, 29 Nov 2008 20:50:22 +0000 (21:50 +0100)] 
Fix minor memory leak in NFLOG plugin.

This patch fix a minor memory leak at NFLOG plugin exit.

16 years agoDon't free pluginstance when leaving
Eric Leblond [Sat, 29 Nov 2008 20:34:46 +0000 (21:34 +0100)] 
Don't free pluginstance when leaving

If we free pluginstance in the stop function we won't
be able to iter anymore on the stack linked list.

16 years agoFix stop function of NFCT plugin.
Eric Leblond [Sat, 29 Nov 2008 20:07:08 +0000 (21:07 +0100)] 
Fix stop function of NFCT plugin.

This patch fixes some crashes in NFCT plugin that were triggered
by the call of the destructor_nfct function (during stop).

16 years agoTreat nice function return.
Eric Leblond [Sat, 29 Nov 2008 14:10:25 +0000 (15:10 +0100)] 
Treat nice function return.

gcc was warning that the return of the nice function should
be treated. This patch adds an error message in case of failure.

16 years agoAdd SCTP support to MySQL and PGSQL output.
Eric Leblond [Fri, 24 Oct 2008 15:53:17 +0000 (17:53 +0200)] 
Add SCTP support to MySQL and PGSQL output.

This patch adds support for SCTP in the MySQL and PGSQL
output plugins. It adds a dedicated SCTP table and modifies
the insert_packet_full procedure.

Signed-off-by: Eric Leblond <eric@inl.fr>
16 years agoSCTP support for PRINTPKT.
Eric Leblond [Fri, 24 Oct 2008 12:32:06 +0000 (14:32 +0200)] 
SCTP support for PRINTPKT.

This patch modifies PRINTPKT plugin to add SCTP support.

Signed-off-by: Eric Leblond <eric@inl.fr>
16 years agoAdd SCTP support to BASE plugin.
Eric Leblond [Fri, 24 Oct 2008 10:44:07 +0000 (12:44 +0200)] 
Add SCTP support to BASE plugin.

THis patch adds basic support for SCTP in the BASE plugin.

Signed-off-by: Eric Leblond <eric@inl.fr>
16 years agoDocument group 0 usage and suppress address_family
Eric Leblond [Mon, 20 Oct 2008 16:42:12 +0000 (18:42 +0200)] 
Document group 0 usage and suppress address_family

Document the fact that group 0 is used by system logging and
update stack and plugin definition to match the suppression
of the address_family variable.

Signed-off-by: Eric Leblond <eric@inl.fr>
16 years agoGet rid of addressfamily variable in NFLOG input plugin
Eric Leblond [Tue, 21 Oct 2008 07:35:20 +0000 (09:35 +0200)] 
Get rid of addressfamily variable in NFLOG input plugin

The addressfamily configuration variable for NFLOG is used as param
for nflog_bind_pf. This function is used to claim the fetching of
kernel message sent via nf_log_packet() function.

As all kernel messages are sent to the group 0, it is useless to
call nflog_bind_pf when nflog group of the input plugin is not 0.
Furthermore, as only one plugin can be bound to nflog group 0, it
is mandatory to call nflog_bind_pf for all pf family when the group
is 0.

To sum up, this patch suppress the adressfamily parameter (which
simplify the configuration file) and call nflog_bind_pf for all
pf family when the nflog group of the instance is 0.

Signed-off-by: Eric Leblond <eric@inl.fr>
16 years agoModify usage of nflog_bind_pf function.
Eric Leblond [Mon, 20 Oct 2008 17:05:15 +0000 (19:05 +0200)] 
Modify usage of nflog_bind_pf function.

The nflog_bind_pf function was called for each NFLOG instance. This patch
modifies the behaviour to have it call if and only if the nfgroup is set
to 0. As the kernel uses only the 0 group to output subsystem messages,
this change clarify the situation.

Signed-off-by: Eric Leblond <eric@inl.fr>
16 years agoadd ukey_* function for key assignation
Pablo Neira Ayuso [Sun, 23 Nov 2008 22:59:44 +0000 (23:59 +0100)] 
add ukey_* function for key assignation

This patch cleans up the current key assignation by introducing a
set of functions ukey_* to set the key value as Eric Leblond and
we discussed during the latest Netfilter Workshop. This patch is
based on an idea from Holger Eitzenberger.

Signed-off-by: Eric Leblond <eric@inl.fr>
16 years agoAdd new output plugin DBI
Pierre Chifflier [Mon, 1 Dec 2008 12:41:55 +0000 (13:41 +0100)] 
Add new output plugin DBI

libdbi implements a database-independent abstraction layer in C, similar to
the DBI/DBD layer in Perl.
This module brings support for all database types supported by libdbi.

Signed-off-by: Pierre Chifflier <chifflier@inl.fr>
Signed-off-by: Eric Leblond <eric@inl.fr>
16 years agoSearch for libdbi includes during configure
Pierre Chifflier [Mon, 1 Dec 2008 12:41:56 +0000 (13:41 +0100)] 
Search for libdbi includes during configure

libdbi is a database-independent abstraction layer in C, similar
to the DBI/DBD layer in Perl.

Signed-off-by: Pierre Chifflier <chifflier@inl.fr>
Signed-off-by: Eric Leblond <eric@inl.fr>
16 years agoLink ulogd2 with libpthread
Pierre Chifflier [Mon, 1 Dec 2008 12:41:53 +0000 (13:41 +0100)] 
Link ulogd2 with libpthread

Explicitly link with libpthread. This allows to run ulogd within gdb,
else it fails with message: Cannot find new threads: generic error

Signed-off-by: Pierre Chifflier <chifflier@inl.fr>
Signed-off-by: Eric Leblond <eric@inl.fr>
16 years agoFix light memory error in parse_mac2str
Pierre Chifflier [Mon, 1 Dec 2008 12:41:54 +0000 (13:41 +0100)] 
Fix light memory error in parse_mac2str

When len is 0 (for ex. when the input mac is NULL), parse_mac2str tries
to calloc a 0-bytes bloc, which leads to a conditional jump based
on uninitialized value (spotted by valgrind).

Signed-off-by: Pierre Chifflier <chifflier@inl.fr>
Signed-off-by: Eric Leblond <eric@inl.fr>
17 years agoNFCT: remove unused constant NFLOG_RMEM_DEFAULT
Pablo Neira Ayuso [Wed, 22 Oct 2008 13:23:55 +0000 (15:23 +0200)] 
NFCT: remove unused constant NFLOG_RMEM_DEFAULT

This patch removes NFLOG_RMEM_DEFAULT which is a reminiscent of the
initial development of NFLOG which is based on the ULOG plugin.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
17 years agopgsql: remove useless checkings
Pierre Chifflier [Mon, 20 Oct 2008 12:01:51 +0000 (14:01 +0200)] 
pgsql: remove useless checkings

This patch removes useless checkings.

Signed-off-by: Pierre Chifflier <chifflier@inl.fr>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
17 years agohwhdr: finish missing renaming
Pierre Chifflier [Mon, 20 Oct 2008 11:55:44 +0000 (13:55 +0200)] 
hwhdr: finish missing renaming

MAC2STR has been renamed to HWHDR.

Signed-off-by: Pierre Chifflier <chifflier@inl.fr>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
17 years agohwhdr: fix segfault when RAW_MAC is NULL
Pierre Chifflier [Mon, 20 Oct 2008 11:53:59 +0000 (13:53 +0200)] 
hwhdr: fix segfault when RAW_MAC is NULL

This fixes a segfault when RAW_MAC key is NULL in MAC2STR plugin.

Signed-off-by: Pierre Chifflier <chifflier@inl.fr>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
17 years agoconfig: remove obsolete global variables
Eric Leblond [Thu, 11 Sep 2008 22:18:22 +0000 (00:18 +0200)] 
config: remove obsolete global variables

'rmem' and 'bufsize' global variables are unherited from ulogd1
and are not used anymore. This patch suppresses them from the
example configuration file.

Signed-off-by: Eric Leblond <eric@inl.fr>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
17 years agodoc: update author credits and fix reference to closed ML
Eric Leblond [Thu, 11 Sep 2008 11:19:05 +0000 (13:19 +0200)] 
doc: update author credits and fix reference to closed ML

This patch adds Eric Lenblond as documentation author and
it removes a reference to the ulogd ML which is closed.

Signed-off-by: Eric Leblond <eric@inl.fr>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
17 years agodoc: update ulogd SGML documentation
Eric Leblond [Thu, 11 Sep 2008 11:15:44 +0000 (13:15 +0200)] 
doc: update ulogd SGML documentation

This patch updates the SGML documentation to be in sync with the latest
version of the code.

Signed-off-by: Eric Leblond <eric@inl.fr>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
17 years agoNFLOG: remove unused option
Eric Leblond [Thu, 11 Sep 2008 11:09:52 +0000 (13:09 +0200)] 
NFLOG: remove unused option

This patch suppresses the "rmem" configuration variable which was
inherited from the original ULOG plugin and which is unused in the
NFLOG plugin.

Signed-off-by: Eric Leblond <eric@inl.fr>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
17 years agodoc: update ulogd man-page
Pablo Neira Ayuso [Thu, 11 Sep 2008 11:06:32 +0000 (13:06 +0200)] 
doc: update ulogd man-page

This patch updates ulogd man page to add information about
the new features.

Based on one Eric Leblond's patch.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
17 years agodistrib: fix distcheck magic ulogd-2.0.0beta2
Pablo Neira Ayuso [Fri, 15 Aug 2008 19:44:22 +0000 (21:44 +0200)] 
distrib: fix distcheck magic

This patch fixes the `make distcheck' magic

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
17 years agocompilation: set -Wno-ununused-parameter in CFLAGS
Eric Leblond [Fri, 1 Aug 2008 08:32:13 +0000 (10:32 +0200)] 
compilation: set -Wno-ununused-parameter in CFLAGS

This patch adds the "-Wno-unused-parameter" option to CFLAGS. This
suppress gcc warning that can not be fixed due to the usage of generic system
like callback where function definition has to be standardized.

Signed-off-by: Eric Leblond <eric@inl.fr>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>