]> git.ipfire.org Git - thirdparty/ulogd2.git/log
thirdparty/ulogd2.git
12 years agoUpdate TODO.
Eric Leblond [Sun, 27 Jan 2013 08:40:30 +0000 (09:40 +0100)] 
Update TODO.

Try to sync TODO with real state of the project.

12 years agographite: fix crash on i386
Eric Leblond [Sun, 17 Feb 2013 21:59:40 +0000 (22:59 +0100)] 
graphite: fix crash on i386

It seems a cast of time_t is needed for i386 system to avoid a
crash. I've added a cast to uint64_t that should be ok on all
Linux system.

Reported-by: netfilter@openenterprise.co.uk
12 years agoFix make distcheck
Eric Leblond [Fri, 25 Jan 2013 19:31:57 +0000 (20:31 +0100)] 
Fix make distcheck

Recently introduced addr.h was missing from Makefile.am.

12 years agoAdd TAGS to .gitignore
Eric Leblond [Fri, 25 Jan 2013 19:20:43 +0000 (20:20 +0100)] 
Add TAGS to .gitignore

12 years agographite: fix warning about gnu extension usage
Eric Leblond [Fri, 18 Jan 2013 20:11:09 +0000 (21:11 +0100)] 
graphite: fix warning about gnu extension usage

clang is complaining about missing = being a gnu extension. This
patch adds equal sign to fix the warning.

12 years agobase: fix warning on pointer handling
Eric Leblond [Fri, 18 Jan 2013 20:10:32 +0000 (21:10 +0100)] 
base: fix warning on pointer handling

12 years agoFix warning on format
Eric Leblond [Fri, 18 Jan 2013 20:09:30 +0000 (21:09 +0100)] 
Fix warning on format

It seems Z is a libc5 only format modifier. Using standard 'z'
instead.

12 years agoGet rid of SVN tag in comment.
Eric Leblond [Fri, 18 Jan 2013 19:19:28 +0000 (20:19 +0100)] 
Get rid of SVN tag in comment.

This patch also update some copyright and licence declaration.

12 years agoAdd -l option to set log level from command line
Eric Leblond [Fri, 18 Jan 2013 18:43:06 +0000 (19:43 +0100)] 
Add -l option to set log level from command line

This patch adds a '-l' option which can be used to setup ulogd
loglevel. Command line option has precedence on the configuration
file one.

12 years agoconf: add flag to allow option setup tuning
Eric Leblond [Fri, 18 Jan 2013 18:41:19 +0000 (19:41 +0100)] 
conf: add flag to allow option setup tuning

This patch adds a flag to the config_entry structure to be able to
tune setup. First usage is to ask config parser not to update a key
if it has been already set.

12 years agoulogd: add -v option to display message on stderr.
Eric Leblond [Sun, 6 Jan 2013 22:12:39 +0000 (23:12 +0100)] 
ulogd: add -v option to display message on stderr.

If can be painful to have to check the logfile, so this patch adds
a '-v' option which display logs message to stderr.

12 years agoaddr: fix compilation warning
Eric Leblond [Sat, 5 Jan 2013 10:04:11 +0000 (11:04 +0100)] 
addr: fix compilation warning

This patch fixes a compilation warning related to a signed and
unsigned integer comparison.

12 years agonfct: add protocol filter
Eric Leblond [Sat, 24 Nov 2012 13:59:30 +0000 (14:59 +0100)] 
nfct: add protocol filter

This patch adds a new configuration variable which is used to limit
conntrack event to connection of these protocols:
For example:
   accept_proto_filter=tcp,sctp

12 years agonfct: implement src and dst filter
Eric Leblond [Mon, 16 Jul 2012 21:03:39 +0000 (23:03 +0200)] 
nfct: implement src and dst filter

This patch implements two filtering options in NFCT input plugin.
If 'accept_src_filter' is set to a network it will only catch the
event where the source is that specific network. 'accept_dst_filter'
does the same for the destination.

12 years agoaddr: add file containing addr utility functions.
Eric Leblond [Tue, 7 Aug 2012 22:06:04 +0000 (00:06 +0200)] 
addr: add file containing addr utility functions.

12 years agonfct: call register callback on opened handler
Eric Leblond [Fri, 24 Aug 2012 08:41:31 +0000 (10:41 +0200)] 
nfct: call register callback on opened handler

nfctp_callback_register was called on the regular handler instead
of begin called on the newly opened handler dedicated to the dump.

12 years agoAdd GRAPHITE output module.
Eric Leblond [Fri, 21 Dec 2012 20:11:23 +0000 (21:11 +0100)] 
Add GRAPHITE output module.

Graphite is a web application which provide real-time visualization
and storage of numeric time-series data. This patch adds a module
named GRAPHITE which sends NFACCT accounting data to a graphite
server.

12 years agoAdd missing u64 function.
Eric Leblond [Fri, 21 Dec 2012 20:11:49 +0000 (21:11 +0100)] 
Add missing u64 function.

12 years agoAdd additional ip6 header fields to database scripts
Bob Hockney [Wed, 19 Dec 2012 19:51:16 +0000 (12:51 -0700)] 
Add additional ip6 header fields to database scripts

Rename internal keyname ip6.payload_len to remove "_"
to facilitate this.

12 years agoHandle postgresql schemas correctly
Bob Hockney [Wed, 19 Dec 2012 19:38:57 +0000 (12:38 -0700)] 
Handle postgresql schemas correctly

Add 'schema' variable to look into corresponding schema.

12 years agoFix parsing of ipv6 flowlabel and tc fields
Bob Hockney [Wed, 19 Dec 2012 19:34:57 +0000 (12:34 -0700)] 
Fix parsing of ipv6 flowlabel and tc fields

Mask should be applied after ntohl conversion.

12 years agobuild: move remaining preprocessor flags into CPPFLAGS
Jan Engelhardt [Tue, 27 Nov 2012 12:45:44 +0000 (13:45 +0100)] 
build: move remaining preprocessor flags into CPPFLAGS

The flags retrieved from `pkg-config --cflags ...` are generally only
preprocessor flags (mostly -I to point to the directories), since
anything else would inconvenience downstream users.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
12 years agobuild: avoid per-target CFLAGS
Jan Engelhardt [Tue, 27 Nov 2012 12:43:42 +0000 (13:43 +0100)] 
build: avoid per-target CFLAGS

There is no harm in putting the includes in the global AM_CPPFLAGS;
this can generally save number of compilations of a file when a
source file is used multiple times.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
12 years agobuild: resolve compile error due to missing nfacct CPPFLAGS
Jan Engelhardt [Mon, 26 Nov 2012 23:52:28 +0000 (00:52 +0100)] 
build: resolve compile error due to missing nfacct CPPFLAGS

Fixes this error:

make[3]: Entering directory "/home/jengelh/code/ulogd2/output"
  CC       ulogd_output_XML.lo
ulogd_output_XML.c:31:49: fatal error:
libnetfilter_acct/libnetfilter_acct.h: No such file or directory

(Note that pkgconfig-provided cflags are actually cppflags, so
I add ${LIBNETFILTER_ACCT_CFLAGS} to AM_CPPFLAGS.)

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
12 years agobuild: resolve automake-1.12 warnings
Jan Engelhardt [Mon, 26 Nov 2012 23:51:09 +0000 (00:51 +0100)] 
build: resolve automake-1.12 warnings

/usr/share/automake-1.12/am/ltlibrary.am: warning:
'ulogd_output_SQLITE3.la': linking libtool libraries using a non-POSIX
archiver requires 'AM_PROG_AR' in 'configure.ac'
(one for each .la)

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
12 years agoXML: add missing include
Eric Leblond [Sun, 4 Nov 2012 08:19:34 +0000 (09:19 +0100)] 
XML: add missing include

Inclusion of libnetfilter_acct.h is not enough as the integer type
definition are not included in the header. So if NFCT is disable, the
compilation fails.

12 years agoUse PRIu64 to print unsigned 64bit int
Eric Leblond [Sat, 3 Nov 2012 13:01:24 +0000 (14:01 +0100)] 
Use PRIu64 to print unsigned 64bit int

12 years agoconfigure: display info about build plugins
Eric Leblond [Sat, 3 Nov 2012 11:19:59 +0000 (12:19 +0100)] 
configure: display info about build plugins

This patch modifies configure to display the list of plugins that
will be built.

12 years agoconfigure: add flag to disable NFLOG build
Eric Leblond [Sat, 3 Nov 2012 10:41:39 +0000 (11:41 +0100)] 
configure: add flag to disable NFLOG build

12 years agoconfigure: add flag to disable NFCT build
Eric Leblond [Sat, 3 Nov 2012 10:40:21 +0000 (11:40 +0100)] 
configure: add flag to disable NFCT build

12 years agoconfigure: add flag to disable NFACCT build
Eric Leblond [Fri, 2 Nov 2012 17:46:22 +0000 (18:46 +0100)] 
configure: add flag to disable NFACCT build

It is now possible to pass the --disable-nfacct flag to disable
compilation of NFACCT input plugin. Doing this the build of ulogd
is possible on system where nfacct is not available.

12 years agoautoconf/ulogd: fix broken libpcap AM_CONDITIONAL
Gustavo Zacarias [Tue, 9 Oct 2012 09:27:19 +0000 (09:27 +0000)] 
autoconf/ulogd: fix broken libpcap AM_CONDITIONAL

The AM_CONDITIONAL lacks the opening bracket, hence it always evaluates
as true, even if there's no libpcap found thus causing build breakage.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
12 years agobump version to 2.0.1 ulogd-2.0.1
Pablo Neira Ayuso [Mon, 8 Oct 2012 11:55:36 +0000 (13:55 +0200)] 
bump version to 2.0.1

And update library dependency. Push users to upgrade to get fixes
from library releases.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
13 years agoipfix: fix bracket imbalance if IPPROTO_SCTP is defined
Thomas Jarosch [Wed, 24 Aug 2011 16:31:02 +0000 (18:31 +0200)] 
ipfix: fix bracket imbalance if IPPROTO_SCTP is defined

Detected by cppcheck.

Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
13 years agosrc: update copyright and authors information
Pablo Neira Ayuso [Fri, 3 Aug 2012 15:05:32 +0000 (17:05 +0200)] 
src: update copyright and authors information

Include Eric and myself in the copyright notice and the AUTHORS file
since we're the most recurrent contributors (of course, after the
original author of this software, Harald Welte).

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
13 years agofilter: IP2HBIN: fix compilation warning with gcc-4.7
Pablo Neira Ayuso [Fri, 3 Aug 2012 14:54:47 +0000 (16:54 +0200)] 
filter: IP2HBIN: fix compilation warning with gcc-4.7

ulogd_filter_IP2HBIN.c: In function 'interp_ip2hbin':
ulogd_filter_IP2HBIN.c:122:6: warning: unused variable 'fret' [-Wunused-variable]

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
13 years agoulogd.conf: slightly expand documentation on zerocounter option for nfacct
Pablo Neira Ayuso [Fri, 3 Aug 2012 14:50:53 +0000 (16:50 +0200)] 
ulogd.conf: slightly expand documentation on zerocounter option for nfacct

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
13 years agonfacct: add timestamp option
Eric Leblond [Wed, 1 Aug 2012 11:27:16 +0000 (11:27 +0000)] 
nfacct: add timestamp option

This patch adds a timestamp option to the nfacct plugin.
If activated, nfacct output a timestamp which is computed just
after sending the nfacct request.

Signed-off-by: Eric Leblond <eric@regit.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
13 years agosrc: fix version that -V displays
Pablo Neira Ayuso [Fri, 3 Aug 2012 14:12:57 +0000 (16:12 +0200)] 
src: fix version that -V displays

It was wrong, use VERSION constant which uses the version
information available in configure.ac.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
13 years agoinput: NFCT: fix compilation warning with gcc-4.7
Pablo Neira Ayuso [Fri, 3 Aug 2012 09:27:37 +0000 (11:27 +0200)] 
input: NFCT: fix compilation warning with gcc-4.7

  CC     ulogd_inpflow_NFCT_la-ulogd_inpflow_NFCT.lo
ulogd_inpflow_NFCT.c: In function 'configure_nfct':
ulogd_inpflow_NFCT.c:977:28: warning: unused variable 'cpi' [-Wunused-variable]

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
13 years agopgsql: only disable key if it starts with underscore
Eric Leblond [Wed, 1 Aug 2012 11:27:15 +0000 (11:27 +0000)] 
pgsql: only disable key if it starts with underscore

ulogd2 was magically making inactive the first key of description
table. This patch improves this system by only doing so when
the key start with an undescore. This way, system like nfacct which
do not have a primary key can be implemented easily.

Signed-off-by: Eric Leblond <eric@regit.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
13 years agopgsql schema: fix timestamp default value
Eric Leblond [Wed, 1 Aug 2012 11:27:14 +0000 (11:27 +0000)] 
pgsql schema: fix timestamp default value

Set timestamp default value to now() not now which is the time at
table creation.

Reported-by: Mr Dash Four <mr.dash.four@googlemail.com>
Signed-off-by: Eric Leblond <eric@regit.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
13 years agopgsql schema: add nfacct table
Eric Leblond [Wed, 1 Aug 2012 11:27:13 +0000 (11:27 +0000)] 
pgsql schema: add nfacct table

This patch adds a nfacct table to the postgresql schema. It enables
the storage of all counters at each poll.

Signed-off-by: Eric Leblond <eric@regit.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
13 years agonfacct: add variable to not zero counter after read
Eric Leblond [Wed, 1 Aug 2012 11:27:12 +0000 (11:27 +0000)] 
nfacct: add variable to not zero counter after read

The default nfacct input plugin zeroes counter after each read. This
is a limitation as other software can't use the counter at the same
time as ulogd2.

This patch adds the zerocounter variable to the NFACCT input plugin.
If set to zero, the counters are not zeroed.

Signed-off-by: Eric Leblond <eric@regit.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
13 years agosqlite3: Add more logging if database initialization fails.
Michael Tremer [Sun, 22 Jul 2012 11:36:11 +0000 (11:36 +0000)] 
sqlite3: Add more logging if database initialization fails.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
13 years agoNFCT: fix crash in polling mode if used by two stacks
Eric Leblond [Wed, 18 Jul 2012 20:56:04 +0000 (20:56 +0000)] 
NFCT: fix crash in polling mode if used by two stacks

The polling timer initialisation code was put in the configurator
code. It was then created for all instances. But only first one has
a valid NFCT handle. This was resulting in a crash.
This patch moves the timer initialisation in the constructor which
is called only once on the main NFCT instance.

Signed-off-by: Eric Leblond <eric@regit.org>
Reported-by: Gomathivinayagam Muthuvinayagam <sankarmail@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
13 years agooutput: XML: display time for NFACCT
Pablo Neira Ayuso [Fri, 22 Jun 2012 15:47:35 +0000 (17:47 +0200)] 
output: XML: display time for NFACCT

<obj><name>test</name><pkts>00000000000000000000</pkts><bytes>00000000000000000000</bytes><hour>17</hour><min>46</min><sec>47</sec><wday>6</wday><day>22</day><month>6</month><year>2012</year></obj>

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
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.