nvtable: Reorganized nvtable helper functions.

Moved nv_table_get_dyn_entries and nv_table_get_entry_at_ofs to the
header, and added nv_table_get_dyn_value_offset_from_nventry.

Signed-off-by: Viktor Tusa <tusa@balabit.hu>
persistable-state: Factor out header from LogProtoBufferedServerState

The first few fields of this struct contains members that are relevant to
all such persistable structures.  It's going to be used by the RCPTID
infrastructure.

Signed-off-by: Viktor Tusa <tusa@balabit.hu>
Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
rcptid: Add unique receipient id framework

This patch adds an rcptid subsytem that can be used to generate per-message
identifiers unique on a given host.

This id is persistent across restarts, and is globally unique for the messages
generated/received on this host/instance.  It is somewhat faster than uuid
template function, but is only a non-zero 48 bit counter.

Signed-off-by: Csaba Karsai <cskarsai@balabit.hu>
Signed-off-by: Viktor Juhasz <jviktor@balabit.hu>
Signed-off-by: Viktor Tusa <tusa@balabit.hu>
Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
cfg: add use-rcptid() global option

This patch adds a use-rcptid() global option that causes syslog-ng to assign
a reception ID to be assigned to all messages received and generated by syslog-ng.

This can be accessed using the $RCPTID macro and is unique on a given host.
The counter wraps around after 48 bits and is never zero.

It can be used to generate a unique ID for a message.

Signed-off-by: Csaba Karsai <cskarsai@balabit.hu>
Signed-off-by: Viktor Juhasz <jviktor@balabit.hu>
Signed-off-by: Viktor Tusa <tusa@balabit.hu>
Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
LogMessage: assign RCPTID to all log messages automatically

Signed-off-by: Csaba Karsai <cskarsai@balabit.hu>
Signed-off-by: Viktor Juhasz <jviktor@balabit.hu>
Signed-off-by: Viktor Tusa <tusa@balabit.hu>
Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
template: add $RCPTID macro

This patch makes the rcptid accessible from templates.

Signed-off-by: Csaba Karsai <cskarsai@balabit.hu>
Signed-off-by: Viktor Juhasz <jviktor@balabit.hu>
Signed-off-by: Viktor Tusa <tusa@balabit.hu>
Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
test_log_message: add static qualifiers to test functions

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
test_log_message: check that rcptid is automatically assigned to a newly created LogMessage