compat/socket.h: define struct sockaddr_storage if not defined by system headers

This patch defines struct sockaddr_storage and removes conditional compilation
from a number of sites that used this structure conditionally.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
afsocket: delegate LogTransport factory function to TransportMapper instance
afsocket: add construct_log_transport() implementation to TransportMapperInet

This addition takes care about creating the TLS session in addition to
creating the LogTransport instance, so the construct_transport() virtual
method can be removed from the src/dest drivers.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
afsocket: remove construct_transport() virtual method from drivers

This is all taken care of by the TransportMapper instance.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
Makefile.am: allow unit tests to use crypto functions

This patch adds crypto related libs to TEST_LDADD, which is
libsyslog-ng-crypto.so if that's compiled separately or libsyslog-ng.so.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
afsocket: added assert_transport_mapper_apply_fails() to transport-mapper-lib


Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
afsocket: build test programs with SSL enabled
afsocket: fix transport-mapper-unix to contain the proper source file

transport-mapper-unix was actually a duplicate of transport-mapper-inet
due to a typo in the Makefile.
afsocket: push TLS related error messages to TransportMapperInet
apphook: fix potential use-after-free at exit
transport: introduce LogTransportAuxData struct

The purpose of this struct to encapsulate transport specific meta
information that relates to a given read operation. Some transports
(like unix-domain sockets) provide additional information that is useful
for syslog-ng, like the PID of the sending process, etc.

This struct makes it possible to carry this kind of meta information
in a format that allows injecting these values as name-value pairs to
messages. The peer GSockAddr address also got its new home in the struct.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
LogProto/LogTransport: use LogTransportAuxData to pass meta information around

Earlier, syslog-ng didn't have the notion of transport/logproto specific
meta information. The only thing that was passed around when receiving
a message is the address of the peer as a GSockAddr instance.

This patch is changing this, it uses the introduced LogTransportAuxData
struct, which encompasses all information that the LogTransport/LogProto
combination is willing to provide.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
LogReader: feed LogTransport provided aux messages into the newly created message

This patch iterates on all nvpairs provided by the LogTransport/LogProto
part and adds them to the newly created LogMessage.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
WIP: query peer PID