]> git.ipfire.org Git - thirdparty/ulogd2.git/log
thirdparty/ulogd2.git
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>
17 years agocleanup: fix warning due to lack of parenthesis
Eric Leblond [Thu, 31 Jul 2008 08:49:08 +0000 (10:49 +0200)] 
cleanup: fix warning due to lack of parenthesis

Fix gcc warning related to the lack of parenthesis.

Signed-off-by: Eric Leblond <eric@inl.fr>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
17 years agocleanup: fix inappropriate initializations in ulogd.c
Eric Leblond [Thu, 31 Jul 2008 08:47:55 +0000 (10:47 +0200)] 
cleanup: fix inappropriate initializations in ulogd.c

This patch fixes some improper initialization in ulogd.c.

Signed-off-by: Eric Leblond <eric@inl.fr>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
17 years agocleanup: fix redefinition of TCP_URG key in printpkt
Eric Leblond [Thu, 31 Jul 2008 08:46:56 +0000 (10:46 +0200)] 
cleanup: fix redefinition of TCP_URG key in printpkt

This patch fixes a multiple definition of the key TCP_URG.

Signed-off-by: Eric Leblond <eric@inl.fr>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
17 years agocleanup: fix warning about integer format
Eric Leblond [Thu, 31 Jul 2008 08:45:27 +0000 (10:45 +0200)] 
cleanup: fix warning about integer format

This patch uses PRIu64 and PRId64 macros from inttypes.h to have a correct
definition of 64 bit integer format for 64bits and 32bits arch.

Signed-off-by: Eric Leblond <eric@inl.fr>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
17 years agocleanup: fix compilation warning about lack of parenthesis
Eric Leblond [Thu, 31 Jul 2008 08:44:15 +0000 (10:44 +0200)] 
cleanup: fix compilation warning about lack of parenthesis

This patch adds parenthesis around an expression to avoid confusion
between order preference of && and || operators.

Signed-off-by: Eric Leblond <eric@inl.fr>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
17 years agocleanup: fix compilation warnings related to pointer comparisons
Eric Leblond [Thu, 31 Jul 2008 08:43:08 +0000 (10:43 +0200)] 
cleanup: fix compilation warnings related to pointer comparisons

This patch cast to (char *) some (void *) to avoid a gcc warning in
string format parsing.

Signed-off-by: Eric Leblond <eric@inl.fr>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org
17 years agocleanup: fix compilation warning related to signed and unsigned comparisons
Eric Leblond [Thu, 31 Jul 2008 08:41:57 +0000 (10:41 +0200)] 
cleanup: fix compilation warning related to signed and unsigned comparisons

This patch fixes the warning related to signed and unsigned comparaison.

Signed-off-by: Eric Leblond <eric@inl.fr>
17 years agocleanup: remove unused timeout parameter in function
Eric Leblond [Thu, 31 Jul 2008 08:40:55 +0000 (10:40 +0200)] 
cleanup: remove unused timeout parameter in function

The function ipulog_read had a timeout parameter which was not
used in the code.

Signed-off-by: Eric Leblond <eric@inl.fr>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
17 years agosyslog: cleanly stops syslog
Eric Leblond [Thu, 31 Jul 2008 08:39:31 +0000 (10:39 +0200)] 
syslog: cleanly stops syslog

This patch adds a stop function to the module which closes the
connection to the log system.

Signed-off-by: Eric Leblond <eric@inl.fr>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
17 years agoDB: update schemas to integrate the link layer information
Eric Leblond [Tue, 29 Jul 2008 13:16:56 +0000 (15:16 +0200)] 
DB: update schemas to integrate the link layer information

This patch adds support for logging the destination mac address and
raw header in the SQL databases.

In case of an ethernet header, a tuple (mac_saddr,mac_daddr,mac_proto)
is logged only once.

Signed-off-by: Pierre Chifflier <chifflier@inl.fr>
Signed-off-by: Eric Leblond <eric@inl.fr>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
17 years agocleanup: fix gcc warnings
Eric Leblond [Tue, 29 Jul 2008 10:24:18 +0000 (12:24 +0200)] 
cleanup: fix gcc warnings

This patch fixes some gcc warnings:
 * Unused variables
 * Functions with wrong return (or without return)

Signed-off-by: Eric Leblond <eric@inl.fr>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
17 years agoNFLOG: minor cleanup
Pablo Neira Ayuso [Tue, 29 Jul 2008 10:12:13 +0000 (12:12 +0200)] 
NFLOG: minor cleanup

break lines at 80 char columns

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
17 years agoMAC2STR: Rename it to HWHDR
Eric Leblond [Tue, 29 Jul 2008 10:11:21 +0000 (12:11 +0200)] 
MAC2STR: Rename it to HWHDR

Use a more appropriate name for this filter.

Signed-off-by: Eric Leblond <eric@inl.fr>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
17 years agoMAC2STR: add support for the new RAW MAC keys
Eric Leblond [Tue, 29 Jul 2008 10:08:19 +0000 (12:08 +0200)] 
MAC2STR: add support for the new RAW MAC keys

This patch modifies MAC2STR to use the new MAC keys that gives us more
accurate information to parse the link layer header. This patch also
does some probing based on the header and field size in the case of
ULOG (since we do not have enough information to perform accurate
parsing).

Signed-off-by: Eric Leblond <eric@inl.fr>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
17 years agoNFLOG: get full link layer header (requires >= 2.6.27)
Eric Leblond [Tue, 29 Jul 2008 09:49:24 +0000 (11:49 +0200)] 
NFLOG: get full link layer header (requires >= 2.6.27)

This patch modifies the key structure of NFLOG. It solves the conflict
between ULOG and NFLOG by ensuring that keys have the same meaning:
 * raw.mac is the full hardware header
 * raw.mac.saddr is the source hardware address
Following Patrick suggestion, it adds a new key "raw.type" which is
used to store the type of hardware.

Signed-off-by: Eric Leblond <eric@inl.fr>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
17 years agoFix a trivial typo
Eric Leblond [Wed, 23 Jul 2008 12:56:31 +0000 (14:56 +0200)] 
Fix a trivial typo

This patch fixes a trivial typo.

Signed-off-by: Eric Leblond <eric@inl.fr>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
17 years agoFix wrong casting warning during compilation
Eric Leblond [Wed, 23 Jul 2008 12:55:44 +0000 (14:55 +0200)] 
Fix wrong casting warning during compilation

This patch cast a expression to avoid a warning.

Signed-off-by: Eric Leblond <eric@inl.fr>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
17 years agoMinor IPFIX fixes
Eric Leblond [Wed, 23 Jul 2008 12:54:25 +0000 (14:54 +0200)] 
Minor IPFIX fixes

IPFIX needs some huge work. This patch fixes some basic logic errors.

Signed-off-by: Eric Leblond <eric@inl.fr>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
17 years agoModify CFLAGS to have useful gcc warnings
Eric Leblond [Wed, 23 Jul 2008 12:53:04 +0000 (14:53 +0200)] 
Modify CFLAGS to have useful gcc warnings

This patch modifies CFLAGS to add -Wall and -Wextra flags to gcc
compilation flag. This will help to detect some stupid problems.

Signed-off-by: Eric Leblond <eric@inl.fr>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
17 years agoFix computation of allocated size for query
Eric Leblond [Thu, 10 Jul 2008 06:31:55 +0000 (08:31 +0200)] 
Fix computation of allocated size for query

This patch fixes the computation of the allocation size for the query.
It was not taking into account the length of the name of the procedure.

Signed-off-by: Eric Leblond <eric@inl.fr>
17 years agoRemove obsolete dist-hook for svn
Eric Leblond [Thu, 10 Jul 2008 06:28:55 +0000 (08:28 +0200)] 
Remove obsolete dist-hook for svn

This patch suppress a dist-hook in Makefile.am which was related
to the suppression of some subversion related files.

Signed-off-by: Eric Leblond <eric@inl.fr>
17 years agorevert commit 3178606785161296dc5a1bd4d42d965db8b3e2cd
Pablo Neira Ayuso [Sat, 28 Jun 2008 10:43:59 +0000 (12:43 +0200)] 
revert commit 3178606785161296dc5a1bd4d42d965db8b3e2cd

We already check for latest library version, this checking
is not required anymore.

Reported-by: Eric Leblond <eric@inl.fr>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
17 years agobump libraries dependencies to lastest release
Pablo Neira Ayuso [Fri, 27 Jun 2008 14:03:57 +0000 (16:03 +0200)] 
bump libraries dependencies to lastest release

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
17 years agosuppress useless debugging message in the ULOG input plugin
Eric Leblond [Mon, 23 Jun 2008 14:45:39 +0000 (16:45 +0200)] 
suppress useless debugging message in the ULOG input plugin

17 years agostructure initialization cleanup
Eric Leblond [Mon, 23 Jun 2008 14:22:08 +0000 (16:22 +0200)] 
structure initialization cleanup

17 years agowhitespace cleanup
Eric Leblond [Mon, 23 Jun 2008 14:21:08 +0000 (16:21 +0200)] 
whitespace cleanup

17 years agoThis patch is a backport of Jaap Keuter fix for PCAP output module.
Eric Leblond [Wed, 18 Jun 2008 15:41:23 +0000 (17:41 +0200)] 
This patch is a backport of Jaap Keuter fix for PCAP output module.

Signed-off-by: Eric Leblond <eric@inl.fr>
17 years agoFix warning in compilation due to missing include
Eric Leblond [Wed, 18 Jun 2008 15:40:48 +0000 (17:40 +0200)] 
Fix warning in compilation due to missing include

strerror function was used without inclusion of string.h. This patch
adds the include and fixes the warning.

Signed-off-by: Eric Leblond <eric@inl.fr>
17 years agoFix NFCT/NFLOG plugin compilation when libraries use non-standard prefix.
Eric Leblond [Wed, 18 Jun 2008 15:39:37 +0000 (17:39 +0200)] 
Fix NFCT/NFLOG plugin compilation when libraries use non-standard prefix.

Fixes compilation of NFLOG and NFCT plugin when libnetfilter libraries
are installed under a non standard prefix. Include path and libs path
for libnetfilter_conntrack and libnetfilter_log were not correctly set even
if pkg-config found them.

Signed-off-by: Eric Leblond <eric@inl.fr>
17 years agoStore MAC in SQL databases only once
Pierre Chifflier [Thu, 12 Jun 2008 09:45:28 +0000 (11:45 +0200)] 
Store MAC in SQL databases only once

This patch modifies the SQL schema for MySQL and PostgreSQL to store
the mac address only once (instead of duplicating the mac address for
each packet). This is done by using a shared reference to the entry
containing the tuple (mac_address,mac_protocol).

Signed-off-by: Pierre Chifflier <chifflier@inl.fr>
17 years agoCleanup: fix error messages and indentation
Eric Leblond [Thu, 12 Jun 2008 09:17:03 +0000 (11:17 +0200)] 
Cleanup: fix error messages and indentation

This patch fixes some messages in the NFCT and NFLOG input
plugin (end of line before quote). It also fixes indenting by
suppressing some spaces on empty line and replacing spaces by tab.

Signed-off-by: Eric Leblond <eric@inl.fr>
17 years agoUpdate configfile for MARK module
Eric Leblond [Thu, 12 Jun 2008 09:15:58 +0000 (11:15 +0200)] 
Update configfile for MARK module

Add stack example for MARK and update some wrong stacks.

Signed-off-by: Eric Leblond <eric@inl.fr>
17 years agoUse ULOGD_IRET_* as return for all interpreters
Eric Leblond [Thu, 12 Jun 2008 09:15:14 +0000 (11:15 +0200)] 
Use ULOGD_IRET_* as return for all interpreters

This patch modifies plugins to use the already defined but not used
define. This also fixes some weird behaviours in error treatment (like
not stopping after OOM).

Signed-off-by: Eric Leblond <eric@inl.fr>
17 years agoFix hexadecimal parsing in config file
Eric Leblond [Thu, 12 Jun 2008 09:10:58 +0000 (11:10 +0200)] 
Fix hexadecimal parsing in config file

The config file parsing was not able to parse integer given in hex notation.
This patch modify the parsing of configfile to be able to use different
integers notation.

Signed-off-by: Eric Leblond <eric@inl.fr>
17 years agoNew MARK-based filter
Eric Leblond [Thu, 12 Jun 2008 09:08:31 +0000 (11:08 +0200)] 
New MARK-based filter

This module filters message by using the mark to decide wether or not a
packet or a flow has to be logged. It takes a mark and a mask option. It
demonstrates the usage of ULOGD_IRET_STOP which can be used to abort
iteration through the stack.

Signed-off-by: Eric Leblond <eric@inl.fr>
17 years agoFix the propagation through the stack
Eric Leblond [Thu, 12 Jun 2008 09:06:28 +0000 (11:06 +0200)] 
Fix the propagation through the stack

When a plugin returns ULOGD_IRET_STOP, the propagation should
stop. This was not the case as break was used to do so but it was called
inside a switch and thus apply to the switch instruction and not to
the llist iteration.

Signed-off-by: Eric Leblond <eric@inl.fr>
17 years agofix crash when SIGHUP is received.
Hugo Mildenberger [Thu, 5 Jun 2008 22:47:15 +0000 (00:47 +0200)] 
fix crash when SIGHUP is received.

crash due to ulogd_logfile set to a string allocated on stack by config_parse_file

17 years agoFix crash when using NFCT with hash_enable=0.
regit [Wed, 4 Jun 2008 13:19:05 +0000 (15:19 +0200)] 
Fix crash when using NFCT with hash_enable=0.

This patch fixes NFCT when hash_enable is 0. Limitation of treatment to
NFCT_DESTROY message type causes usage of the hashtable function and
hence a crash because it is not initiated.

Signed-off-by: regit <regit@ghlodit.inl.fr>
Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years agoSource and destination addresses were put in ptr field of the target structure
Eric Leblond [Mon, 2 Jun 2008 00:02:09 +0000 (02:02 +0200)] 
Source and destination addresses were put in ptr field of the target structure
instead of being put in the new type ui128. The result was an improper value
of the IPv6 source add destination addresses.

17 years agoadds some examples to the configuration file
Eric Leblond [Sun, 1 Jun 2008 23:44:26 +0000 (01:44 +0200)] 
adds some examples to the configuration file

17 years agoModify the code by activating overrun handling if and only if the local hash is used...
Eric Leblond [Sun, 1 Jun 2008 23:44:09 +0000 (01:44 +0200)] 
Modify the code by activating overrun handling if and only if the local hash is used (hash_enable=1 which is the default)

17 years agoThis patch adds a new function which insert or update connection tracking
Eric Leblond [Sun, 1 Jun 2008 23:42:44 +0000 (01:42 +0200)] 
This patch adds a new function which insert or update connection tracking
entries depending on the event type parameter.

17 years agoSync SQL fields with NFCT keys
Eric Leblond [Sun, 1 Jun 2008 23:41:45 +0000 (01:41 +0200)] 
Sync SQL fields with NFCT keys

17 years agoFill every possible timestamp. It fills START timestamp for NEW packet and STOP times...
Eric Leblond [Sun, 1 Jun 2008 23:41:18 +0000 (01:41 +0200)] 
Fill every possible timestamp. It fills START timestamp for NEW packet and STOP timestamp for DESTROY packet

17 years agoSet timestamp in NFLOG for INPUT and OUTPUT
Eric Leblond [Sun, 1 Jun 2008 23:40:41 +0000 (01:40 +0200)] 
Set timestamp in NFLOG for INPUT and OUTPUT