]> git.ipfire.org Git - thirdparty/ulogd2.git/log
thirdparty/ulogd2.git
10 years agoSet release number to 2.0.5.
Eric Leblond [Fri, 3 Apr 2015 00:48:45 +0000 (02:48 +0200)] 
Set release number to 2.0.5.

10 years agoinclude: keep a copy of linux/netfilter_ipv4/ipt_ULOG.h
Pablo Neira Ayuso [Fri, 7 Nov 2014 17:33:01 +0000 (18:33 +0100)] 
include: keep a copy of linux/netfilter_ipv4/ipt_ULOG.h

This fixes compilation if you use a Linux kernel >= 3.17. This problem
occurs since ULOG was removed from mainstream:

http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=7200135bc1e61f1437dc326ae2ef2f310c50b4eb

Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=986
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
10 years agoFix JSON output on big endian systems
Jimmy Jones [Sat, 26 Jul 2014 20:48:38 +0000 (21:48 +0100)] 
Fix JSON output on big endian systems

Signed-off-by: Jimmy Jones <jimmyjones2@gmx.co.uk>
11 years agogitignore: add manpage
Eric Leblond [Tue, 1 Jul 2014 19:09:19 +0000 (21:09 +0200)] 
gitignore: add manpage

Signed-off-by: Eric Leblond <eric@regit.org>
11 years agogitignore: ignore generated documentation
Vincent Bernat [Fri, 27 Jun 2014 08:13:57 +0000 (10:13 +0200)] 
gitignore: ignore generated documentation

Signed-off-by: Vincent Bernat <Vincent.Bernat@exoscale.ch>
11 years agoSet release number to 2.0.4. ulogd-2.0.4
Eric Leblond [Mon, 3 Mar 2014 23:21:10 +0000 (00:21 +0100)] 
Set release number to 2.0.4.

Signed-off-by: Eric Leblond <eric@regit.org>
11 years agoulogd: fix loglevel handling
Ken-ichirou MATSUZAWA [Fri, 7 Mar 2014 22:03:48 +0000 (23:03 +0100)] 
ulogd: fix loglevel handling

It was always default if not specified by command parameter.

Signed-off-by: Ken-ichirou MATSUZAWA <chamas@h4.dion.ne.jp>
11 years agoprintpkt: oob.time.sec was not used
Eric Leblond [Fri, 7 Mar 2014 21:49:37 +0000 (22:49 +0100)] 
printpkt: oob.time.sec was not used

This patch supresses the oob.time.sec from the input keys as this
is not used when creating the string corresponding to the packet.

Signed-off-by: Eric Leblond <eric@regit.org>
11 years agojson: use packet timestamp if available
Eric Leblond [Fri, 7 Mar 2014 20:11:47 +0000 (21:11 +0100)] 
json: use packet timestamp if available

This patch updates the JSON output plugin to have it use the
timestamp of the packet if available. The date format used
for the timestamp is now using ISO 8601 to have an easy
import in most software (tested with logstash and splunk).

Signed-off-by: Eric Leblond <eric@regit.org>
11 years agonfct: use start timestamp if provided
Eric Leblond [Sat, 22 Feb 2014 13:05:56 +0000 (14:05 +0100)] 
nfct: use start timestamp if provided

When hash table is not used, the start timestamp was not used even
if the kernel is sending it. This patch modifies the code to use it
when available. This allows to log connection with start and end
with a single message per connection and without the cost of
maintaining the hash table.

11 years agoulogd: add carriage return as separator
Eric Leblond [Tue, 4 Feb 2014 08:27:45 +0000 (09:27 +0100)] 
ulogd: add carriage return as separator

If the file is in DOS mode, the string coming from config file
parsing are containing the carriage return. The result is that
string are not correct and the parsing of confuguration file
is failling.

11 years agoulogd: avoid potential double print of message
Eric Leblond [Mon, 3 Feb 2014 23:33:47 +0000 (00:33 +0100)] 
ulogd: avoid potential double print of message

In case there is no logfile, ulogd could possibly display each
log message twice to stderr.

11 years agojson: introduce new JSON output plugin
Eric Leblond [Sun, 26 Jan 2014 16:05:29 +0000 (17:05 +0100)] 
json: introduce new JSON output plugin

This patch introduces a new JSON output plugin. This
patch displays CIM field name instead of ulogd key valu
if this CIM field is available.

The module does not display binary address but uses the
string version of them. So a complete stack is for example:
 stack=log2:NFLOG,base1:BASE,ifi1:IFINDEX,ip2str1:IP2STR,mac2str1:HWHDR,json1:JSON

If boolean_label is set to 1, then the numeric_label put on packet
by the input plugin is coding the decision on packet. If 0, then
packet has been blocked and if non null it has been accepted.

11 years agostore Common Information Model name in ulogd key
Eric Leblond [Sun, 26 Jan 2014 21:21:42 +0000 (22:21 +0100)] 
store Common Information Model name in ulogd key

This patch adds storage for CIM field name in ulogd key. This
will be used by JSON output to interoperate with logging
collector such as logstash or splunk.

Common Information Model is an open standard that defines how managed
elements in an IT environment are represented as a common set of objects
and relationships between them:
 http://www.dmtf.org/standards/cim

This seems to be mainly XML based but there is a JSON version of some
aspects of the model. One of the main documentation on CIM in JSON
format seems to be:
 http://docs.splunk.com/Documentation/PCI/2.0/DataSource/CommonInformationModelFieldReference

Using the correct CIM field name allow events coming from ulogd to be
correlated with events coming from other sources.

11 years agodb: don't loose one packet on reconnect
Eric Leblond [Sun, 26 Jan 2014 10:33:54 +0000 (11:33 +0100)] 
db: don't loose one packet on reconnect

This patch improves database reconnection handling in ring buffer
mode. Ulogd now redo the failed query and do not loose anymore
one packet.

11 years agodb: cancel injection thread when terminating
Eric Leblond [Sat, 25 Jan 2014 11:51:49 +0000 (12:51 +0100)] 
db: cancel injection thread when terminating

Injection thread was not cancelled when a termination signal was
sent. This was causing a crash in some cases. This patch fixes this
by canceling the thread when a SIGTERM or SIGINT signal is received.

11 years agodb: set ring default size to 0
Eric Leblond [Sat, 25 Jan 2014 11:26:38 +0000 (12:26 +0100)] 
db: set ring default size to 0

As default size was non null, the ring system was activated by
default. It was only possible to desactivate the ring system
by setting it to ring_buffer_size to 0 in the configuration.

This was not the attended behavior. This patch set it to 0 to have
only explicit activation of the ring feature.

11 years agoutil: fix warning on format string
Eric Leblond [Sat, 25 Jan 2014 10:46:52 +0000 (11:46 +0100)] 
util: fix warning on format string

pp_print macro was not correctly formatting u64. This patch renames
it to pp_print_u as it is only used to print integer. It also use
the PRIu* macros to have a correct format string for all integers
type.

11 years agonacct: fix format warning
Eric Leblond [Sat, 25 Jan 2014 10:46:14 +0000 (11:46 +0100)] 
nacct: fix format warning

Some counter have been recently switch to u64. This has caused warnings
relative to format string. This patch uses PRIu64 macro to fix these
warnings.

11 years agoulogd: use AC_SEARCH_LIBS for libpthread
Gustavo Zacarias [Tue, 10 Dec 2013 12:24:12 +0000 (09:24 -0300)] 
ulogd: use AC_SEARCH_LIBS for libpthread

Some uClibc-based toolchains lack threading support, so use
AC_SEARCH_LIB instead of AC_CHECK_LIB to check for libpthread
availability and link conditionally if found since it's only used for
the database backends.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
11 years agoSet release number to 2.0.3. ulogd-2.0.3
Eric Leblond [Sun, 13 Oct 2013 21:21:30 +0000 (23:21 +0200)] 
Set release number to 2.0.3.

Signed-off-by: Eric Leblond <eric@regit.org>
11 years agoulogd: ulogd_inppkt_NFLOG: close nflog handle after unbinding
Chris Boot [Mon, 18 Nov 2013 11:09:14 +0000 (11:09 +0000)] 
ulogd: ulogd_inppkt_NFLOG: close nflog handle after unbinding

The nflog handle is closed, and then nflog_unbind_pf() is called on it, which
triggers an assertion failure within libnfnetlink. This patch simply moves
the nflog_close() just after the nflog_unbind_pf() calls.

Signed-off-by: Chris Boot <bootc@bootc.net>
11 years agonfct: make NFCT packet counter/length 64 bit
Ulrich Weber [Wed, 9 Oct 2013 10:00:01 +0000 (12:00 +0200)] 
nfct: make NFCT packet counter/length 64 bit

Kernel and libnetfilter_conntrack counters are 64bit,
so use 64bit too in ulogd instead of 32bit.

Worked fine on little endian systems but big endian systems
had zero counter...

Didn't test ipfix output, but RFC allows template with
either 32 or 64 counters, so should be safe.

Signed-off-by: Ulrich Weber <uw@xyne.com>
Signed-off-by: Eric Leblond <eric@regit.org>
11 years agoulogd: use daemon() function
Eric Leblond [Sat, 20 Jul 2013 10:08:33 +0000 (12:08 +0200)] 
ulogd: use daemon() function

This patches update the daemonization code. It is done earlier and
it uses the daemon(à function which is used for daemonization by
most projects.

Signed-off-by: Eric Leblond <eric@regit.org>
11 years agoulogd.conf: add missing quote.
Eric Leblond [Sat, 20 Jul 2013 10:17:08 +0000 (12:17 +0200)] 
ulogd.conf: add missing quote.

Pcap file variable was not quoted. This was confusing
as the correct file was not open if the user did
uncomment the variable.

Signed-off-by: Eric Leblond <eric@regit.org>
12 years agopgsql: add var to specify arbitrary conn params
Eric Leblond [Tue, 28 May 2013 19:58:57 +0000 (21:58 +0200)] 
pgsql: add var to specify arbitrary conn params

This patch adds a configuration variable for PostgreSQL output.
Named connstring it stores the character string that will be
used to connect to the PostgreSQL server. This allows the user
to use all options available like TLS parameters for example.

Signed-off-by: Eric Leblond <eric@regit.org>
12 years agoImprove pid file handling.
Eric Leblond [Sat, 18 May 2013 13:25:11 +0000 (15:25 +0200)] 
Improve pid file handling.

This patch improves latest patch by splitting in two part the pid
file creation. This allows to display a message to stdout when
ulogd can not be started. Another linked improvement is that the
plugin initialization is not done if the pid file existence will
result in a ulogd exit.

Signed-off-by: Eric Leblond <eric@regit.org>
12 years agoulogd: Implement PID file writing
Chris Boot [Sun, 12 May 2013 12:47:40 +0000 (13:47 +0100)] 
ulogd: Implement PID file writing

The deamon currently does not have the ability to write a PID file to track its
process ID. This is very useful to an init script and to ensure there is only
one running instance. This patch implements this functionality.

Signed-off-by: Chris Boot <bootc@bootc.net>
12 years agoulogd: Perform nice() before giving up root
Chris Boot [Sat, 11 May 2013 17:01:52 +0000 (18:01 +0100)] 
ulogd: Perform nice() before giving up root

The daemon code currently tries to nice(-1) just after having given up root
privileges, which fails. This patch moves the nice(-1) call to just before
the code that gives up the required privileges.

Signed-off-by: Chris Boot <bootc@bootc.net>
12 years agoExec libmnl config check only if nfacct is enabled
Victor Julien [Fri, 5 Apr 2013 16:28:14 +0000 (18:28 +0200)] 
Exec libmnl config check only if nfacct is enabled

In case nfacct is not enabled in ulogd2, libmnl is not used. So it shouldn't
be a hard global dependency, but instead only a dependency in case nfacct is
enabled.

12 years agodb: db ring has precedence over backlog.
Eric Leblond [Thu, 9 May 2013 10:57:20 +0000 (12:57 +0200)] 
db: db ring has precedence over backlog.

12 years agodb: disable SIGHUP if ring buffer is used.
Eric Leblond [Thu, 9 May 2013 09:20:37 +0000 (11:20 +0200)] 
db: disable SIGHUP if ring buffer is used.

The handling of signal when using threads can be complicated. When
ring buffer is used for query, this means ulogd will have to follow
some sort of mutex. Thus, it is easier and better performance wise
to disable the reload via SIGHUP when the ring buffer is used.

12 years agodb: add ring buffer for DB query
Eric Leblond [Sat, 20 Apr 2013 10:44:17 +0000 (12:44 +0200)] 
db: add ring buffer for DB query

This patch adds an optional ring buffer option which modify
the way database queries are made. The main thread is only handling
kernel message reading and query formatting. The SQL request is made
in a separate dedicated thread.
The idea is to try to avoid buffer overrun by minimizing the time
requested to treat kernel message. Doing synchronous SQL request, as
it was made before was causing a delay which could cause some messages
to be lost in case of burst from kernel side.

12 years agodb: use offset instead of direct pointer.
Eric Leblond [Tue, 19 Mar 2013 23:03:35 +0000 (00:03 +0100)] 
db: use offset instead of direct pointer.

Use an offset approach to get the start of values printing area. It
is more generic and will be use soon.

12 years agodb: suppress field in db structure
Eric Leblond [Tue, 19 Mar 2013 22:57:16 +0000 (23:57 +0100)] 
db: suppress field in db structure

The field is currently only used in a single function as a string
pointer and can thus be removed from the db instance structure.

12 years agodb: store data in memory during database downtime
Eric Leblond [Sun, 17 Mar 2013 18:41:36 +0000 (19:41 +0100)] 
db: store data in memory during database downtime

This patch is adding a mechanism to store query in a backlog build
in memory. This allow to store events during downtime in memory and
realize the effective insertion when the database comes back.
A memory cap is used to avoid any memory flooding.

12 years agosqlite3: add sanity checking
Eric Leblond [Sun, 17 Mar 2013 23:25:01 +0000 (00:25 +0100)] 
sqlite3: add sanity checking

Nullify sqlite3 handler at deinit.

12 years agomysql: add sanity checking
Eric Leblond [Sun, 17 Mar 2013 23:24:17 +0000 (00:24 +0100)] 
mysql: add sanity checking

Nullify mysql handler at deinit.

12 years agopostgresql: add sanity checking
Eric Leblond [Sun, 17 Mar 2013 20:43:51 +0000 (21:43 +0100)] 
postgresql: add sanity checking

Clean postgresql handler at deinit.

12 years agoFix automagic support of dbi, pcap and sqlite3
Ilya Tumaykin [Wed, 20 Mar 2013 10:54:36 +0000 (14:54 +0400)] 
Fix automagic support of dbi, pcap and sqlite3

ulogd has automagic deps for several output plugins right now, namely dbi,
pcap and sqlite3. These plugins are built if the appropriate libs are present
on user's system. While this situation is fine with binary distros it is not OK
on source-based ones such as Gentoo.

The problem arises when such a program links against libs without user's
request and libs are later removed from system which leaves program in a
broken state.

This patch is modifying configure.ac which we apply in our package and which
fixes mentioned issue. It adds 3 new configure options: --
without-{dbi,pcap.sqlite}. I would like to emphasize that this patch doesn't
change default behaviour of configure script at all, so all other distros won't
suffer. We simply add options to explicitly disable any attempts to try and
detect libs for automagic deps, which is enough to avoid unnecessary linkage.

12 years agoulogd: display stack during configuration
Eric Leblond [Tue, 19 Mar 2013 23:24:17 +0000 (00:24 +0100)] 
ulogd: display stack during configuration

12 years agoRevert "ulogd: close logfile description in the exit path of parent process"
Pablo Neira Ayuso [Tue, 26 Mar 2013 23:07:31 +0000 (00:07 +0100)] 
Revert "ulogd: close logfile description in the exit path of parent process"

This reverts commit 3179bd4de89de7c2388849f5bc48e8f5aad9e5b9.

Pointing to the wrong place. This is not the file descriptor
that ulogd is leaking.

12 years agoulogd: close logfile description in the exit path of parent process
Pablo Neira Ayuso [Tue, 26 Mar 2013 21:48:58 +0000 (22:48 +0100)] 
ulogd: close logfile description in the exit path of parent process

Joan Touzet reported that file descriptor 3 was not ever closed
in the exit path of the parent process:

open("ulogd.conf", O_RDONLY)            = 3

That corresponds to the the file descriptor that was used to
parse the configuration file was not closed.

This closes: http://bugzilla.netfilter.org/show_bug.cgi?id=793

Reported-by: Joan Touzet <joant@cloudant.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
12 years agoulogd: change verbosity of a message
Eric Leblond [Tue, 19 Mar 2013 23:18:06 +0000 (00:18 +0100)] 
ulogd: change verbosity of a message

The "registering plugin" message is not really useful as the message
is really explicit if a plugin is missing.

12 years agonfct: use timestamp of conntrack object.
Eric Leblond [Sat, 2 Mar 2013 20:16:41 +0000 (21:16 +0100)] 
nfct: use timestamp of conntrack object.

If conntrack object sent by connection tracking system is containing
a timestamp we use it instead of a gettimeofday() based counter.

Signed-off-by: Eric Leblond <eric@regit.org>
12 years agoPrepare release number to 2.0.2 ulogd-2.0.2
Eric Leblond [Fri, 25 Jan 2013 19:37:26 +0000 (20:37 +0100)] 
Prepare release number to 2.0.2

Update release number and delete Changes file because we can use
git changelog fot that.

12 years agoUpdate README
Eric Leblond [Wed, 20 Feb 2013 18:10:23 +0000 (19:10 +0100)] 
Update README

Get rid of ULOG only documentation and adds some new stuffs.

12 years agoUpdate man page.
Eric Leblond [Wed, 20 Feb 2013 17:33:59 +0000 (18:33 +0100)] 
Update man page.

12 years agologemu: return error if configuration is invalid.
Eric Leblond [Mon, 18 Feb 2013 15:03:25 +0000 (16:03 +0100)] 
logemu: return error if configuration is invalid.

12 years agoAdd handling of too long line and arguments.
Eric Leblond [Sat, 9 Feb 2013 20:36:48 +0000 (21:36 +0100)] 
Add handling of too long line and arguments.

When an argument or a line is too long, it can not be store
into ulogd configuration and this must results in a error.

12 years agoFix typo in comments.
Eric Leblond [Sat, 9 Feb 2013 19:55:16 +0000 (20:55 +0100)] 
Fix typo in comments.

12 years agoUse access to ensure readability of config gile
Eric Leblond [Sat, 9 Feb 2013 19:49:56 +0000 (20:49 +0100)] 
Use access to ensure readability of config gile

This patch adds a call to access to check the readability of the
configuration file.

12 years agoSuppress dead FIXME.
Eric Leblond [Sat, 9 Feb 2013 19:17:33 +0000 (20:17 +0100)] 
Suppress dead FIXME.

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>