basicfuncs: actually run unit tests for various template functions

These calls were somehow factored out and thus unit tests were not actually
run. Fortunately no functions were broken in the meantime.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
basicfuncs: added unit test coverage for $(indent-multi-line)

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
versioning.h: introduce syslog-ng 3.5

This patch allows the use of the '@version: 3.5' cookie in syslog-ng.conf
files.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
affile: rename no_expand to filename_is_a_template

Double negation as happened with this variable name is difficult to decipher,
so change no_expand to filename_is_a_template that makes the code
easier to read.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
affile: introduce multi-line-mode() option

This patch adds the multi-line-mode option to the file/pipe sources so
that lines can be continued by indenting subsequent lines can be used.

Use:
  file("/foo/bar" multi-line-mode(indented));

The file should have this format:

first line
  continuation line 1
  continuation line 2
second line

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
afsocket: Require libsystemd-daemon for socket activation

Instead of carrying a convenience copy of sd-daemon.c and sd-daemon.h,
require libsystemd-daemon for socket activation. If the library is not
found, systemd support will be disabled.

This is so other parts of syslog-ng can easily use systemd things
aswell, without having to move sd-daemon.* to lib/ or some similar
place.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
system-source: Use libsystemd-daemon functions

Instead of reimplementing various checks, use the functionality
provided by libsystemd-daemon to do the same things better.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
scl: Two reusable blocks to mask or hash credit card numbers

Contributed by Marton Illes <marci@balabit.com>, the two rewrite
blocks -credit-card-mask and credit-card-hash - can be used to mask or
hash credit card numbers that may appear in log messages.

For more information about the topic, see his blog post at:
 http://marci.blogs.balabit.com/2013/02/masking-credit-card-numbers-in-log-messages-with-syslog-ng/

The block names were changed to be less cryptic, and the regexp was
lifted out into a shared define.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
value-pairs: Rename replace() to replace-prefix()

This renames the replace() value-pairs rekey option to
replace-prefix(), because that is what it does. This is done for both
the value-pairs() grammar, and for the command-line-like parser used
for template functions too.

For compatibility's sake, replace() remains as an alias for now, but
it is marked as obsolete, and will emit a warning.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
afmongodb: Remove the username() and password() options

These were never documented, and they never worked either, and there
appears no demand for it, either. Best remove them, until such time
that they can be implemented sanely.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
tests/functional: Bump config versions to 3.5

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
travis: Don't install syslog-ng before make check

make check should work even when syslog-ng is uninstalled, so lets
test this property too, by not installing it.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
lib/logproto/Makefile.in: added missing Makefile.in

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
plugin-types.h: new header to define LL_CONTEXT_* macros

This role of this header is to define the LL_CONTEXT_* macros used by
various plugin implementations. For now it simply includes the cfg-grammar.h,
in the future it could remove the namespace poisoning that this causes by
using a different means.

The reason this became a dedicated header is that it is sometimes difficult
to grasp why a given code requires code generated by bison from the main
configuration file parser.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
plugin.h: remove cfg-grammar.h inclusion

To break dependency between libtest and lib, don't automatically include
cfg-grammar.h here, rather require the call-sites to include plugin-types.h
explicitly if they need those constants.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
afmongodb, afsmtp, cryptofuncs: fix include order, system headers should come last

The include order policy is that we include local includes first (so that
we get config.h at the end) and include system headers afterwards.
The reasons are simple:
  * this way all headers must include their required interface dependencies
    themselves and can't rely on the .c file doing this instead
  * this way we can use HAVE_XXX macros defined by configure

config.h shouldn't be included directly, syslog-ng.h (the root for
all headers) should do that instead.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
pacct: fixed compilation errors

This plugin has rotten somewhat and become uncompilable, fixed all compilation
issues.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>