syslog-ng source
logmsg-serialize.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010-2015 Balabit
3  * Copyright (c) 2015 Viktor Juhasz <viktor.juhasz@balabit.com>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18  *
19  * As an additional exemption you are allowed to compile & link against the
20  * OpenSSL libraries as published by the OpenSSL project. See the file
21  * COPYING for details.
22  *
23  */
24 
25 
26 #ifndef LOGMSG_SERIALIZE_H
27 #define LOGMSG_SERIALIZE_H
28 
29 #include "serialize.h"
30 #include "timeutils/unixtime.h"
31 
32 /*
33  * version info
34  * 0 first introduced in syslog-ng-2.1
35  * 1 dropped self->date
36  * 10 added support for values,
37  * sd data,
38  * syslog-protocol fields,
39  * timestamps became 64 bits,
40  * removed source group string
41  * flags & pri became 16 bits
42  * 11 flags became 32 bits
43  * 12 store tags
44  * 20 usage of the nvtable
45  * 21 sdata serialization
46  * 22 corrected nvtable serialization
47  * 23 new RCTPID field (64 bits)
48  * 24 new processed timestamp
49  * 25 added hostid
50  * 26 use 32 bit values nvtable
51  */
52 
54 {
55  LGM_V01 = 1,
56  LGM_V10 = 10,
57  LGM_V11 = 11,
58  LGM_V12 = 12,
59  LGM_V20 = 20,
60  LGM_V21 = 21,
61  LGM_V22 = 22,
62  LGM_V23 = 23,
63  LGM_V24 = 24,
64  LGM_V25 = 25,
65  LGM_V26 = 26
66 };
67 
69 {
70  LMSF_COMPACTION = 0x0001,
71 };
72 
73 gboolean log_msg_deserialize(LogMessage *self, SerializeArchive *sa);
74 gboolean log_msg_serialize_with_ts_processed(LogMessage *self, SerializeArchive *sa, const UnixTime *processed,
75  guint32 flags);
76 gboolean log_msg_serialize(LogMessage *self, SerializeArchive *sa, guint32 flags);
77 
78 #endif
gboolean log_msg_serialize(LogMessage *self, SerializeArchive *sa, guint32 flags)
Definition: logmsg-serialize.c:103
gboolean log_msg_serialize_with_ts_processed(LogMessage *self, SerializeArchive *sa, const UnixTime *processed, guint32 flags)
Definition: logmsg-serialize.c:90
_LogMessageSerializationFlags
Definition: logmsg-serialize.h:69
@ LMSF_COMPACTION
Definition: logmsg-serialize.h:70
gboolean log_msg_deserialize(LogMessage *self, SerializeArchive *sa)
Definition: logmsg-serialize.c:512
_LogMessageVersion
Definition: logmsg-serialize.h:54
@ LGM_V24
Definition: logmsg-serialize.h:63
@ LGM_V23
Definition: logmsg-serialize.h:62
@ LGM_V21
Definition: logmsg-serialize.h:60
@ LGM_V25
Definition: logmsg-serialize.h:64
@ LGM_V22
Definition: logmsg-serialize.h:61
@ LGM_V11
Definition: logmsg-serialize.h:57
@ LGM_V10
Definition: logmsg-serialize.h:56
@ LGM_V12
Definition: logmsg-serialize.h:58
@ LGM_V26
Definition: logmsg-serialize.h:65
@ LGM_V20
Definition: logmsg-serialize.h:59
@ LGM_V01
Definition: logmsg-serialize.h:55
SerializeArchive * sa
Definition: test_timestamp_serialize.c:31