syslog-ng source
versioning.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2002-2016 Balabit
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17  *
18  * As an additional exemption you are allowed to compile & link against the
19  * OpenSSL libraries as published by the OpenSSL project. See the file
20  * COPYING for details.
21  *
22  */
23 
24 #ifndef __VERSIONING_H__
25 #define __VERSIONING_H__
26 
27 /* The aim of this header file is to make it easy to track version
28  * identification in code when porting code from the PE tree to the OSE tree
29  * or vice versa. Error and warning messages should always use these macros
30  * instead of inlining a concrete version number. Runtime checks should
31  * always use the get_version_value() function to convert OSE version codes
32  * to PE ones.
33  *
34  ****************************************************************************
35  * The code _should_ always use OSE version numbering, otherwise it'd break *
36  * and confuse the user when code gets ported between trees. *
37  ****************************************************************************
38  *
39  * Versions in error messages
40  * ==========================
41  *
42  * Whenever using an error message that needs to state a version number, it
43  * should use one of the VERSION_X_Y macros, X_Y identifying the OSE version
44  * number where the incompatible change was applied.
45  *
46  * Example:
47  *
48  * msg_warning("WARNING: foo got changed to bar in " VERSION_3_4");
49  *
50  * Incompatible changes in non-OSE products
51  * ========================================
52  *
53  * If you introduce an incompatible change in a private tree (but don't do
54  * that), you should explicitly define a macro that identifies your version,
55  * e.g. if you have a product named foo, which is based on syslog-ng 3.3
56  * and you decide to change the interpretation of a config syntax in your
57  * 1.0 release, you should create a macro:
58  *
59  * VERSION_FOO_1_0 "foo 1.0"
60  *
61  * This would be changed once the code gets integrated into syslog-ng, to
62  * the "integrated-to" release. That way, users that always used OSE gets
63  * the version number properly.
64  *
65  * Rebasing to a tree that already has your incompatible change
66  * ============================================================
67  *
68  * Assuming your change makes it to the OSE tree, the FOO specific version
69  * references will be changed to OSE version macros, which could be a
70  * problem for you when rebase your product, since your rebased product will
71  * claim that the incompatible change happened _after_ it really happened.
72  * The best solution is not to introduce incompatible changes or do that in
73  * the OSE tree first. If you have to something like this, make sure that
74  * you take care about these at rebase time.
75  *
76  * Version number barrier
77  * ======================
78  *
79  * For now there's an explicit barrier in version numbering between PE and
80  * OSE, which is "4.0"; everything below "4.0" is an OSE version number,
81  * everything ahead is a PE one. This will change once there's sufficient
82  * gap between the two (e.g. PE 4.0 is long forgotten), in that case
83  * OSE can also use version 4 and later.
84  *
85  * If there's another similar products built on syslog-ng (e.g. someone
86  * other than BB creates such a product, the same scheme can be used by them
87  * too).
88  */
89 
90 /* version references for major syslog-ng OSE versions. All error messages
91  * should reference the syslog-ng version number through these macros, in order
92  * to make it relatively simple to explain PE/OSE version numbers to users. */
93 
94 #define PRODUCT_DOCUMENTATION "\n\thttps://www.syslog-ng.com/technical-documents/list/syslog-ng-open-source-edition"
95 #define PRODUCT_CONTACT "\n\tGitHub Project: https://github.com/syslog-ng/syslog-ng\n\tChat with the Developers: https://gitter.im/syslog-ng/syslog-ng\n\tMailing List: https://lists.balabit.hu/mailman/listinfo/syslog-ng"
96 
97 #define VERSION_3_0 "syslog-ng 3.0"
98 #define VERSION_3_1 "syslog-ng 3.1"
99 #define VERSION_3_2 "syslog-ng 3.2"
100 #define VERSION_3_3 "syslog-ng 3.3"
101 #define VERSION_3_4 "syslog-ng 3.4"
102 #define VERSION_3_5 "syslog-ng 3.5"
103 #define VERSION_3_6 "syslog-ng 3.6"
104 #define VERSION_3_7 "syslog-ng 3.7"
105 #define VERSION_3_8 "syslog-ng 3.8"
106 #define VERSION_3_9 "syslog-ng 3.9"
107 #define VERSION_3_10 "syslog-ng 3.10"
108 #define VERSION_3_11 "syslog-ng 3.11"
109 #define VERSION_3_12 "syslog-ng 3.12"
110 #define VERSION_3_13 "syslog-ng 3.13"
111 #define VERSION_3_14 "syslog-ng 3.14"
112 #define VERSION_3_15 "syslog-ng 3.15"
113 #define VERSION_3_16 "syslog-ng 3.16"
114 #define VERSION_3_17 "syslog-ng 3.17"
115 #define VERSION_3_18 "syslog-ng 3.18"
116 #define VERSION_3_19 "syslog-ng 3.19"
117 #define VERSION_3_20 "syslog-ng 3.20"
118 #define VERSION_3_21 "syslog-ng 3.21"
119 #define VERSION_3_22 "syslog-ng 3.22"
120 #define VERSION_3_23 "syslog-ng 3.23"
121 #define VERSION_3_24 "syslog-ng 3.24"
122 #define VERSION_3_25 "syslog-ng 3.25"
123 #define VERSION_3_26 "syslog-ng 3.26"
124 #define VERSION_3_27 "syslog-ng 3.27"
125 #define VERSION_3_28 "syslog-ng 3.28"
126 #define VERSION_3_29 "syslog-ng 3.29"
127 #define VERSION_3_30 "syslog-ng 3.30"
128 #define VERSION_3_31 "syslog-ng 3.31"
129 #define VERSION_3_32 "syslog-ng 3.32"
130 #define VERSION_3_33 "syslog-ng 3.33"
131 #define VERSION_3_34 "syslog-ng 3.34"
132 #define VERSION_3_35 "syslog-ng 3.35"
133 #define VERSION_3_36 "syslog-ng 3.36"
134 #define VERSION_3_37 "syslog-ng 3.37"
135 #define VERSION_3_38 "syslog-ng 3.38"
136 
137 #define VERSION_4_0 "syslog-ng 4.0"
138 #define VERSION_4_1 "syslog-ng 4.1"
139 #define VERSION_4_2 "syslog-ng 4.2"
140 #define VERSION_4_3 "syslog-ng 4.3"
141 #define VERSION_4_4 "syslog-ng 4.4"
142 #define VERSION_4_5 "syslog-ng 4.5"
143 #define VERSION_4_6 "syslog-ng 4.6"
144 #define VERSION_4_7 "syslog-ng 4.7"
145 #define VERSION_4_8 "syslog-ng 4.8"
146 #define VERSION_4_9 "syslog-ng 4.9"
147 #define VERSION_4_10 "syslog-ng 4.10"
148 #define VERSION_4_11 "syslog-ng 4.11"
149 
150 /* VERSION_VALUE_* references versions as integers to be compared against stuff like cfg->user_version */
151 /* VERSION_STR_* references versions as strings to be shown to the user */
152 
153 #define VERSION_VALUE_3_0 0x0300
154 #define VERSION_VALUE_3_1 0x0301
155 #define VERSION_VALUE_3_2 0x0302
156 #define VERSION_VALUE_3_3 0x0303
157 #define VERSION_VALUE_3_4 0x0304
158 #define VERSION_VALUE_3_5 0x0305
159 #define VERSION_VALUE_3_6 0x0306
160 #define VERSION_VALUE_3_7 0x0307
161 #define VERSION_VALUE_3_8 0x0308
162 #define VERSION_VALUE_3_9 0x0309
163 #define VERSION_VALUE_3_10 0x030a
164 #define VERSION_VALUE_3_11 0x030b
165 #define VERSION_VALUE_3_12 0x030c
166 #define VERSION_VALUE_3_13 0x030d
167 #define VERSION_VALUE_3_14 0x030e
168 #define VERSION_VALUE_3_15 0x030f
169 #define VERSION_VALUE_3_16 0x0310
170 #define VERSION_VALUE_3_17 0x0311
171 #define VERSION_VALUE_3_18 0x0312
172 #define VERSION_VALUE_3_19 0x0313
173 #define VERSION_VALUE_3_20 0x0314
174 #define VERSION_VALUE_3_21 0x0315
175 #define VERSION_VALUE_3_22 0x0316
176 #define VERSION_VALUE_3_23 0x0317
177 #define VERSION_VALUE_3_24 0x0318
178 #define VERSION_VALUE_3_25 0x0319
179 #define VERSION_VALUE_3_26 0x031a
180 #define VERSION_VALUE_3_27 0x031b
181 #define VERSION_VALUE_3_28 0x031c
182 #define VERSION_VALUE_3_29 0x031d
183 #define VERSION_VALUE_3_30 0x031e
184 #define VERSION_VALUE_3_31 0x031f
185 #define VERSION_VALUE_3_32 0x0320
186 #define VERSION_VALUE_3_33 0x0321
187 #define VERSION_VALUE_3_34 0x0322
188 #define VERSION_VALUE_3_35 0x0323
189 #define VERSION_VALUE_3_36 0x0324
190 #define VERSION_VALUE_3_37 0x0325
191 #define VERSION_VALUE_3_38 0x0326
192 #define VERSION_VALUE_4_0 0x0400
193 #define VERSION_VALUE_4_1 0x0401
194 #define VERSION_VALUE_4_2 0x0402
195 #define VERSION_VALUE_4_3 0x0403
196 #define VERSION_VALUE_4_4 0x0404
197 #define VERSION_VALUE_4_5 0x0405
198 #define VERSION_VALUE_4_6 0x0406
199 #define VERSION_VALUE_4_7 0x0407
200 #define VERSION_VALUE_4_8 0x0408
201 #define VERSION_VALUE_4_9 0x0409
202 #define VERSION_VALUE_4_10 0x040a
203 #define VERSION_VALUE_4_11 0x040b
204 
205 /* config version code, in the same format as GlobalConfig->version */
206 #define VERSION_VALUE_CURRENT VERSION_VALUE_4_11
207 #define VERSION_STR_CURRENT "4.11"
208 #define VERSION_PRODUCT_CURRENT VERSION_4_11
209 
210 /* this value points to the last syslog-ng version where we changed the
211  * meaning of any setting in the configuration file. Basically, it is the
212  * highest value passed to any cfg_is_config_version_older() call.
213  */
214 #define VERSION_VALUE_LAST_SEMANTIC_CHANGE VERSION_VALUE_4_2
215 #define VERSION_STR_LAST_SEMANTIC_CHANGE "4.2"
216 
217 #define version_convert_from_user(v) (v)
218 
219 /* version based feature flips */
220 #define VERSION_VALUE_NEXT_MAJOR VERSION_VALUE_4_0
221 
222 /* we are already past 4.0 which introduced FEATURE_TYPING_MIN_VERSION, so
223  * set min_version to an extremal value. We should remove this macro if all
224  * derived works introduce typing support. Until that point we keep it
225  * here, so the same codebase can execute with typing disabled. */
226 #define FEATURE_TYPING_MIN_VERSION 0
227 #define FEATURE_TYPING_VERSION "syslog-ng 4.0"
228 
229 #include "pe-versioning.h"
230 #endif