... | ... |
@@ -49,7 +49,7 @@ MAIN_NAME=ser |
49 | 49 |
VERSION = 0 |
50 | 50 |
PATCHLEVEL = 8 |
51 | 51 |
SUBLEVEL = 99 |
52 |
-EXTRAVERSION = -dev5 |
|
52 |
+EXTRAVERSION = -dev6 |
|
53 | 53 |
|
54 | 54 |
RELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) |
55 | 55 |
OS = $(shell uname -s | sed -e s/SunOS/solaris/ | tr "[A-Z]" "[a-z]") |
... | ... |
@@ -282,7 +282,7 @@ endif |
282 | 282 |
|
283 | 283 |
|
284 | 284 |
DEFS+= $(extra_defs) \ |
285 |
- -DNAME='"$(NAME)"' -DVERSION='"$(RELEASE)"' -DARCH='"$(ARCH)"' \ |
|
285 |
+ -DNAME='"$(MAIN_NAME)"' -DVERSION='"$(RELEASE)"' -DARCH='"$(ARCH)"' \ |
|
286 | 286 |
-DOS='"$(OS)"' -DCOMPILER='"$(CC_VER)"' -D__CPU_$(ARCH) -D__OS_$(OS) \ |
287 | 287 |
-DCFG_DIR='"$(cfg-target)"'\ |
288 | 288 |
-DPKG_MALLOC \ |
289 | 289 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,40 @@ |
1 |
+# $Id$ |
|
2 |
+# A short history of ser beginnings |
|
3 |
+# |
|
4 |
+# by Andrei Pelinescu-Onciul <pelinescu-onciul@fokus.fraunhofer.de> |
|
5 |
+ |
|
6 |
+This is a short ser history based mainly on my memory and my old mail archive. I've tried to mention only the important events. I'm sure I have missed a lot of things and/or people. If this is your case, please don't feel offended, send me an email and I will straighten things up. |
|
7 |
+ |
|
8 |
+ |
|
9 |
+ |
|
10 |
+Three years ago on 4 September 2001 I committed the first working ser version on a private cvs. In fact I started writting ser 2 days before, on 2nd September. |
|
11 |
+ I was supposed to write some kind of sip glue for a Cisco PSTN gateway in 1 week, but of course I did it in the last 2 days :-) |
|
12 |
+ |
|
13 |
+At that time the config looked like: |
|
14 |
+ |
|
15 |
+# method_re sip_uri_re dest_host |
|
16 |
+# (warning: re cannot contain space) |
|
17 |
+ |
|
18 |
+^R.* ^sip:.*@dorian.* ekina.fokus.gmd.de |
|
19 |
+^INVITE .* ape:5061 # my laptop |
|
20 |
+. . 192.168.46.55 |
|
21 |
+ |
|
22 |
+A short time after this Jiri began testing the code and requesting new features.2 weeks later I completely changed the config format bringing it pretty close to what we have today. At the time Jiri stronlgy disagreed with the ideea arguing that the new config would increase code complexity too much and would severely |
|
23 |
+ impact performance. The final argument was: I already wrote the code and it works :-) |
|
24 |
+In Octomber 2001 I made some changes to ser routing language bringing it to what we still use today. |
|
25 |
+In the next months I've created the module interface, the first two modules (print and textops) and I've added the shared memory support (this involved the creation of ser's own malloc library which proved to be much faster for ser's memory usage patterns than standards malloc implementations). |
|
26 |
+During the same period Bogdan and Jan joined me and Jiri also began writing code. |
|
27 |
+In December 2001 Bogdan announced that tm was up an running (after a sleepless night). |
|
28 |
+At the beginning of 2002 we were joined by Daniel. Jan introduced the mysql, usrloc and auth modules. |
|
29 |
+Ser first public appearance was at the April 2002 Sipit. We ran it on a pda an still managed to be faster than the testing tools that were used against us :-) |
|
30 |
+ |
|
31 |
+In May 2002 ser got ipv6 support. |
|
32 |
+In August 2002 Nils commited sipsak to berlios (very usefull testing tool). |
|
33 |
+In September 2002 ser went public: it was GPL'ed and the cvs tree was moved to berlios. During the same month Jiri introduced the FIFO interface, Karel committed serweb and we had the first GPL'ed release: ser 0.8.8. |
|
34 |
+In December 2002 ser got its first big external contribution: the enum module, written by Juha Heinanen. |
|
35 |
+In January 2003 Raphael commited sems on berlios. |
|
36 |
+In February 2003 ser got tcp support. |
|
37 |
+Sometime during the 2003 spring ser got the permissions module from Miklos Tirpak and nathelper from Maxim Sobolev. |
|
38 |
+In August 2003, Uli commited isdngw to sems. |
|
39 |
+ |
|
40 |
+All the rest is too new to be in the history :-) |
... | ... |
@@ -63,6 +63,7 @@ |
63 | 63 |
* 2004-03-09 open_fifo_server split into init_ and start_ (andrei) |
64 | 64 |
* 2004-04-29 added chown(sock_user, sock_group) (andrei) |
65 | 65 |
* 2004-06-06 updated to the new DB interface & init_db_fifo (andrei) |
66 |
+ * 2004-09-19 fifo is deleted on exit (destroy_fifo) (andrei) |
|
66 | 67 |
*/ |
67 | 68 |
|
68 | 69 |
|
... | ... |
@@ -157,6 +158,17 @@ void destroy_fifo() |
157 | 158 |
pkg_free(c); |
158 | 159 |
c=foo; |
159 | 160 |
} |
161 |
+ if (fifo_stream){ |
|
162 |
+ fclose(fifo_stream); |
|
163 |
+ fifo_stream=0; |
|
164 |
+ /* if FIFO was created, delete it */ |
|
165 |
+ if (fifo && strlen(fifo)){ |
|
166 |
+ if (unlink(fifo)<0){ |
|
167 |
+ LOG(L_ERR, "WARNING: destroy_fifo: cannot delete fifo (%s):" |
|
168 |
+ " %s\n", fifo, strerror(errno)); |
|
169 |
+ } |
|
170 |
+ } |
|
171 |
+ } |
|
160 | 172 |
} |
161 | 173 |
|
162 | 174 |
|
... | ... |
@@ -123,6 +123,13 @@ inline static gen_lock_t* lock_init(gen_lock_t* lock) |
123 | 123 |
#include <sys/ipc.h> |
124 | 124 |
#include <sys/sem.h> |
125 | 125 |
|
126 |
+#include <errno.h> |
|
127 |
+#include <string.h> |
|
128 |
+#include <sys/types.h> |
|
129 |
+#include <unistd.h> |
|
130 |
+#include "dprint.h" |
|
131 |
+#include "globals.h" /* uid */ |
|
132 |
+ |
|
126 | 133 |
#if ((defined(HAVE_UNION_SEMUN) || defined(__GNU_LIBRARY__) )&& !defined(_SEM_SEMUN_UNDEFINED)) |
127 | 134 |
|
128 | 135 |
/* union semun is defined by including sem.h */ |
... | ... |
@@ -144,8 +151,14 @@ typedef int gen_lock_t; |
144 | 151 |
inline static gen_lock_t* lock_init(gen_lock_t* lock) |
145 | 152 |
{ |
146 | 153 |
union semun su; |
154 |
+ int euid; |
|
147 | 155 |
|
156 |
+ euid=geteuid(); |
|
157 |
+ if (uid && uid!=euid) |
|
158 |
+ seteuid(uid); /* set euid to the cfg. requested one */ |
|
148 | 159 |
*lock=semget(IPC_PRIVATE, 1, 0700); |
160 |
+ if (uid && uid!=euid) |
|
161 |
+ seteuid(euid); /* restore it */ |
|
149 | 162 |
if (*lock==-1) return 0; |
150 | 163 |
su.val=1; |
151 | 164 |
if (semctl(*lock, 0, SETVAL, su)==-1){ |
... | ... |
@@ -245,11 +258,18 @@ inline static gen_lock_set_t* lock_set_init(gen_lock_set_t* s) |
245 | 258 |
{ |
246 | 259 |
union semun su; |
247 | 260 |
int r; |
248 |
- |
|
261 |
+ int euid; |
|
262 |
+ |
|
263 |
+ euid=geteuid(); |
|
264 |
+ if (uid && uid!=euid) |
|
265 |
+ seteuid(uid); /* set euid to the cfg. requested one */ |
|
249 | 266 |
s->semid=semget(IPC_PRIVATE, s->size, 0700); |
267 |
+ if (uid && uid!=euid) |
|
268 |
+ seteuid(euid); /* restore euid */ |
|
250 | 269 |
if (s->semid==-1){ |
251 |
- LOG(L_CRIT, "ERROR: lock_set_init (SYSV): semget failed: %s\n", |
|
252 |
- strerror(errno)); |
|
270 |
+ LOG(L_CRIT, "ERROR: lock_set_init (SYSV): semget (..., %d, 0700)" |
|
271 |
+ " failed: %s\n", |
|
272 |
+ s->size, strerror(errno)); |
|
253 | 273 |
return 0; |
254 | 274 |
} |
255 | 275 |
su.val=1; |
... | ... |
@@ -122,90 +122,13 @@ |
122 | 122 |
#ifdef DEBUG_DMALLOC |
123 | 123 |
#include <dmalloc.h> |
124 | 124 |
#endif |
125 |
+#include "version.h" |
|
125 | 126 |
|
126 | 127 |
static char id[]="@(#) $Id$"; |
127 |
-static char version[]= NAME " " VERSION " (" ARCH "/" OS ")" ; |
|
128 |
-static char compiled[]= __TIME__ " " __DATE__ ; |
|
129 |
-static char flags[]= |
|
130 |
-"STATS:" |
|
131 |
-#ifdef STATS |
|
132 |
-"On" |
|
133 |
-#else |
|
134 |
-"Off" |
|
135 |
-#endif |
|
136 |
-#ifdef USE_IPV6 |
|
137 |
-", USE_IPV6" |
|
138 |
-#endif |
|
139 |
-#ifdef USE_TCP |
|
140 |
-", USE_TCP" |
|
141 |
-#endif |
|
142 |
-#ifdef USE_TLS |
|
143 |
-", USE_TLS" |
|
144 |
-#endif |
|
145 |
-#ifdef DISABLE_NAGLE |
|
146 |
-", DISABLE_NAGLE" |
|
147 |
-#endif |
|
148 |
-#ifdef USE_MCAST |
|
149 |
-", USE_MCAST" |
|
150 |
-#endif |
|
151 |
-#ifdef NO_DEBUG |
|
152 |
-", NO_DEBUG" |
|
153 |
-#endif |
|
154 |
-#ifdef NO_LOG |
|
155 |
-", NO_LOG" |
|
156 |
-#endif |
|
157 |
-#ifdef EXTRA_DEBUG |
|
158 |
-", EXTRA_DEBUG" |
|
159 |
-#endif |
|
160 |
-#ifdef DNS_IP_HACK |
|
161 |
-", DNS_IP_HACK" |
|
162 |
-#endif |
|
163 |
-#ifdef SHM_MEM |
|
164 |
-", SHM_MEM" |
|
165 |
-#endif |
|
166 |
-#ifdef SHM_MMAP |
|
167 |
-", SHM_MMAP" |
|
168 |
-#endif |
|
169 |
-#ifdef PKG_MALLOC |
|
170 |
-", PKG_MALLOC" |
|
171 |
-#endif |
|
172 |
-#ifdef VQ_MALLOC |
|
173 |
-", VQ_MALLOC" |
|
174 |
-#endif |
|
175 |
-#ifdef F_MALLOC |
|
176 |
-", F_MALLOC" |
|
177 |
-#endif |
|
178 |
-#ifdef USE_SHM_MEM |
|
179 |
-", USE_SHM_MEM" |
|
180 |
-#endif |
|
181 |
-#ifdef DBG_QM_MALLOC |
|
182 |
-", DBG_QM_MALLOC" |
|
183 |
-#endif |
|
184 |
-#ifdef DEBUG_DMALLOC |
|
185 |
-", DEBUG_DMALLOC" |
|
186 |
-#endif |
|
187 |
-#ifdef FAST_LOCK |
|
188 |
-", FAST_LOCK" |
|
189 |
-#ifdef BUSY_WAIT |
|
190 |
-"-BUSY_WAIT" |
|
191 |
-#endif |
|
192 |
-#ifdef USE_PTHREAD_MUTEX |
|
193 |
-", USE_PTHREAD_MUTEX" |
|
194 |
-#endif |
|
195 |
-#ifdef USE_POSIX_SEM |
|
196 |
-", USE_POSIX_SEM" |
|
197 |
-#endif |
|
198 |
-#ifdef USE_SYSV_SEM |
|
199 |
-", USE_SYSV_SEM" |
|
200 |
-#endif |
|
201 |
-#ifdef ADAPTIVE_WAIT |
|
202 |
-"-ADAPTIVE_WAIT" |
|
203 |
-#endif |
|
204 |
-#ifdef NOSMP |
|
205 |
-"-NOSMP" |
|
206 |
-#endif |
|
207 |
-#endif /*FAST_LOCK*/ |
|
208 |
-; |
|
128 |
+static char* version=SER_FULL_VERSION; |
|
129 |
+static char* flags=SER_COMPILE_FLAGS; |
|
130 |
+char compiled[]= __TIME__ " " __DATE__ ; |
|
131 |
+ |
|
209 | 132 |
|
210 | 133 |
static char help_msg[]= "\ |
211 | 134 |
Usage: " NAME " -l address [-p port] [-l address [-p port]...] [options]\n\ |
... | ... |
@@ -423,7 +346,8 @@ char* pgid_file = 0; |
423 | 346 |
void cleanup(show_status) |
424 | 347 |
{ |
425 | 348 |
/*clean-up*/ |
426 |
- shm_unlock(); /* hack: force-unlock the shared memory lock in case |
|
349 |
+ if (mem_lock) |
|
350 |
+ shm_unlock(); /* hack: force-unlock the shared memory lock in case |
|
427 | 351 |
some process crashed and let it locked; this will |
428 | 352 |
allow an almost gracious shutdown */ |
429 | 353 |
destroy_modules(); |
... | ... |
@@ -1124,6 +1048,9 @@ int main_loop() |
1124 | 1048 |
|
1125 | 1049 |
/*return 0; */ |
1126 | 1050 |
error: |
1051 |
+ is_main=1; /* if we are here, we are the "main process", |
|
1052 |
+ any forked children should exit with exit(-1) and not |
|
1053 |
+ ever use return */ |
|
1127 | 1054 |
return -1; |
1128 | 1055 |
|
1129 | 1056 |
} |
... | ... |
@@ -1345,20 +1272,6 @@ try_again: |
1345 | 1272 |
DBG("test random number %u\n", rand()); |
1346 | 1273 |
|
1347 | 1274 |
|
1348 |
- |
|
1349 |
- |
|
1350 |
- /*init shm mallocs (before parsing cfg !) |
|
1351 |
- * this must be here to allow setting shm mem size from the command line |
|
1352 |
- * and it must also be before init_timer and init_tcp |
|
1353 |
- * => if shm_mem should be settable from the cfg file move everything |
|
1354 |
- * after --andrei */ |
|
1355 |
- if (init_shm_mallocs()==-1) |
|
1356 |
- goto error; |
|
1357 |
- /*init timer, before parsing the cfg!*/ |
|
1358 |
- if (init_timer()<0){ |
|
1359 |
- LOG(L_CRIT, "could not initialize timer, exiting...\n"); |
|
1360 |
- goto error; |
|
1361 |
- } |
|
1362 | 1275 |
|
1363 | 1276 |
/* register a diagnostic FIFO command - moved to fifo server - bogdan |
1364 | 1277 |
if (register_core_fifo()<0) { |
... | ... |
@@ -1444,6 +1357,24 @@ try_again: |
1444 | 1357 |
fprintf(stderr, "config file ok, exiting...\n"); |
1445 | 1358 |
goto error; |
1446 | 1359 |
} |
1360 |
+ |
|
1361 |
+ |
|
1362 |
+ /*init shm mallocs |
|
1363 |
+ * this must be here |
|
1364 |
+ * -to allow setting shm mem size from the command line |
|
1365 |
+ * => if shm_mem should be settable from the cfg file move |
|
1366 |
+ * everything after |
|
1367 |
+ * -it must be also before init_timer and init_tcp |
|
1368 |
+ * -it must be after we know uid (so that in the SYSV sems case, |
|
1369 |
+ * the sems will have the correct euid) |
|
1370 |
+ * --andrei */ |
|
1371 |
+ if (init_shm_mallocs()==-1) |
|
1372 |
+ goto error; |
|
1373 |
+ /*init timer, before parsing the cfg!*/ |
|
1374 |
+ if (init_timer()<0){ |
|
1375 |
+ LOG(L_CRIT, "could not initialize timer, exiting...\n"); |
|
1376 |
+ goto error; |
|
1377 |
+ } |
|
1447 | 1378 |
|
1448 | 1379 |
#ifdef USE_TCP |
1449 | 1380 |
if (!tcp_disable){ |
... | ... |
@@ -31,6 +31,7 @@ |
31 | 31 |
* 2003-03-12 split shm_mem_init in shm_getmem & shm_mem_init_mallocs |
32 | 32 |
* (andrei) |
33 | 33 |
* 2004-07-27 ANON mmap support, needed on darwin (andrei) |
34 |
+ * 2004-09-19 shm_mem_destroy: destroy first the lock & then unmap (andrei) |
|
34 | 35 |
*/ |
35 | 36 |
|
36 | 37 |
|
... | ... |
@@ -223,6 +224,10 @@ void shm_mem_destroy() |
223 | 224 |
#endif |
224 | 225 |
|
225 | 226 |
DBG("shm_mem_destroy\n"); |
227 |
+ if (mem_lock){ |
|
228 |
+ DBG("destroying the shared memory lock\n"); |
|
229 |
+ lock_destroy(mem_lock); /* we don't need to dealloc it*/ |
|
230 |
+ } |
|
226 | 231 |
if (shm_mempool && (shm_mempool!=(void*)-1)) { |
227 | 232 |
#ifdef SHM_MMAP |
228 | 233 |
munmap(shm_mempool, /* SHM_MEM_SIZE */ shm_mem_size ); |
... | ... |
@@ -237,10 +242,6 @@ void shm_mem_destroy() |
237 | 242 |
shm_shmid=-1; |
238 | 243 |
} |
239 | 244 |
#endif |
240 |
- if (mem_lock){ |
|
241 |
- DBG("destroying the shared memory lock\n"); |
|
242 |
- lock_destroy(mem_lock); /* we don't need to dealloc it*/ |
|
243 |
- } |
|
244 | 245 |
} |
245 | 246 |
|
246 | 247 |
|
... | ... |
@@ -32,6 +32,7 @@ |
32 | 32 |
* 2003-03-19 Support for flags in find_export (janakj) |
33 | 33 |
* 2003-03-29 cleaning pkg_mallocs introduced (jiri) |
34 | 34 |
* 2003-04-24 module version checking introduced (jiri) |
35 |
+ * 2004-09-19 compile flags are checked too (andrei) |
|
35 | 36 |
*/ |
36 | 37 |
|
37 | 38 |
|
... | ... |
@@ -156,6 +157,7 @@ error: |
156 | 157 |
static inline int version_control(void *handle, char *path) |
157 | 158 |
{ |
158 | 159 |
char **m_ver; |
160 |
+ char **m_flags; |
|
159 | 161 |
char* error; |
160 | 162 |
|
161 | 163 |
m_ver=(char **)dlsym(handle, DLSYM_PREFIX "module_version"); |
... | ... |
@@ -164,14 +166,33 @@ static inline int version_control(void *handle, char *path) |
164 | 166 |
path, error ); |
165 | 167 |
return 0; |
166 | 168 |
} |
169 |
+ m_flags=(char **)dlsym(handle, DLSYM_PREFIX "module_flags"); |
|
170 |
+ if ((error=(char *)dlerror())!=0) { |
|
171 |
+ LOG(L_ERR, "ERROR: no compile flags info in module <%s>: %s\n", |
|
172 |
+ path, error ); |
|
173 |
+ return 0; |
|
174 |
+ } |
|
167 | 175 |
if (!m_ver || !(*m_ver)) { |
168 | 176 |
LOG(L_ERR, "ERROR: no version in module <%s>\n", path ); |
169 | 177 |
return 0; |
170 | 178 |
} |
171 |
- if (strcmp(VERSION,*m_ver)==0) |
|
172 |
- return 1; |
|
179 |
+ if (!m_flags || !(*m_flags)) { |
|
180 |
+ LOG(L_ERR, "ERROR: no compile flags in module <%s>\n", path ); |
|
181 |
+ return 0; |
|
182 |
+ } |
|
183 |
+ |
|
184 |
+ if (strcmp(SER_FULL_VERSION, *m_ver)==0){ |
|
185 |
+ if (strcmp(SER_COMPILE_FLAGS, *m_flags)==0) |
|
186 |
+ return 1; |
|
187 |
+ else { |
|
188 |
+ LOG(L_ERR, "ERROR: module compile flags mismatch for %s " |
|
189 |
+ " \ncore: %s \nmodule: %s\n", |
|
190 |
+ path, SER_COMPILE_FLAGS, *m_flags); |
|
191 |
+ return 0; |
|
192 |
+ } |
|
193 |
+ } |
|
173 | 194 |
LOG(L_ERR, "ERROR: module version mismatch for %s; " |
174 |
- "core: %s; module: %s\n", path, VERSION, *m_ver ); |
|
195 |
+ "core: %s; module: %s\n", path, SER_FULL_VERSION, *m_ver ); |
|
175 | 196 |
return 0; |
176 | 197 |
} |
177 | 198 |
|
... | ... |
@@ -35,6 +35,7 @@ |
35 | 35 |
* 2003-04-05 s/reply_route/failure_route, onreply_route introduced (jiri) |
36 | 36 |
* 2004-03-12 extra flag USE_FUNC_PARAM added to modparam type - |
37 | 37 |
* instead of copying the param value, a func is called (bogdan) |
38 |
+ * 2004-09-19 switched to version.h for the module versions checks (andrei) |
|
38 | 39 |
*/ |
39 | 40 |
|
40 | 41 |
|
... | ... |
@@ -42,6 +43,7 @@ |
42 | 43 |
#define sr_module_h |
43 | 44 |
|
44 | 45 |
#include "parser/msg_parser.h" /* for sip_msg */ |
46 |
+#include "version.h" |
|
45 | 47 |
|
46 | 48 |
typedef struct module_exports* (*module_register)(); |
47 | 49 |
typedef int (*cmd_function)(struct sip_msg*, char*, char*); |
... | ... |
@@ -78,7 +80,9 @@ typedef int (*param_func_t)( modparam_t type, param_func_param_t param_val); |
78 | 80 |
#define PROC_TCP_MAIN -4 /* TCP main process */ |
79 | 81 |
#define PROC_UNIXSOCK -5 /* Unix domain socket server processes */ |
80 | 82 |
|
81 |
-#define MODULE_VERSION char *module_version=VERSION; |
|
83 |
+#define MODULE_VERSION \ |
|
84 |
+ char *module_version=SER_FULL_VERSION; \ |
|
85 |
+ char *module_flags=SER_COMPILE_FLAGS; |
|
82 | 86 |
|
83 | 87 |
struct cmd_export_ { |
84 | 88 |
char* name; /* null terminated command name */ |
85 | 89 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,200 @@ |
1 |
+/* |
|
2 |
+ * $Id$ |
|
3 |
+ * |
|
4 |
+ * version and compile flags macros |
|
5 |
+ * |
|
6 |
+ * |
|
7 |
+ * Copyright (C) 2004 FhG Fokus |
|
8 |
+ * |
|
9 |
+ * This file is part of ser, a free SIP server. |
|
10 |
+ * |
|
11 |
+ * ser is free software; you can redistribute it and/or modify |
|
12 |
+ * it under the terms of the GNU General Public License as published by |
|
13 |
+ * the Free Software Foundation; either version 2 of the License, or |
|
14 |
+ * (at your option) any later version |
|
15 |
+ * |
|
16 |
+ * For a license to use the ser software under conditions |
|
17 |
+ * other than those described here, or to purchase support for this |
|
18 |
+ * software, please contact iptel.org by e-mail at the following addresses: |
|
19 |
+ * info@iptel.org |
|
20 |
+ * |
|
21 |
+ * ser is distributed in the hope that it will be useful, |
|
22 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
23 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
24 |
+ * GNU General Public License for more details. |
|
25 |
+ * |
|
26 |
+ * You should have received a copy of the GNU General Public License |
|
27 |
+ * along with this program; if not, write to the Free Software |
|
28 |
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
29 |
+ */ |
|
30 |
+ |
|
31 |
+#ifndef version_h |
|
32 |
+#define version_h |
|
33 |
+ |
|
34 |
+#define SER_FULL_VERSION NAME " " VERSION " (" ARCH "/" OS ")" |
|
35 |
+ |
|
36 |
+ |
|
37 |
+#ifdef STATS |
|
38 |
+#define STATS_STR "STATS: On" |
|
39 |
+#else |
|
40 |
+#define STATS_STR "STATS: Off" |
|
41 |
+#endif |
|
42 |
+ |
|
43 |
+#ifdef USE_IPV6 |
|
44 |
+#define USE_IPV6_STR ", USE_IPV6" |
|
45 |
+#else |
|
46 |
+#define USE_IPV6_STR "" |
|
47 |
+#endif |
|
48 |
+ |
|
49 |
+#ifdef USE_TCP |
|
50 |
+#define USE_TCP_STR ", USE_TCP" |
|
51 |
+#else |
|
52 |
+#define USE_TCP_STR "" |
|
53 |
+#endif |
|
54 |
+ |
|
55 |
+#ifdef USE_TLS |
|
56 |
+#define USE_TLS_STR ", USE_TLS" |
|
57 |
+#else |
|
58 |
+#define USE_TLS_STR "" |
|
59 |
+#endif |
|
60 |
+ |
|
61 |
+ |
|
62 |
+#ifdef DISABLE_NAGLE |
|
63 |
+#define DISABLE_NAGLE_STR ", DISABLE_NAGLE" |
|
64 |
+#else |
|
65 |
+#define DISABLE_NAGLE_STR "" |
|
66 |
+#endif |
|
67 |
+ |
|
68 |
+#ifdef USE_MCAST |
|
69 |
+#define USE_MCAST_STR ", USE_MCAST" |
|
70 |
+#else |
|
71 |
+#define USE_MCAST_STR "" |
|
72 |
+#endif |
|
73 |
+ |
|
74 |
+ |
|
75 |
+#ifdef NO_DEBUG |
|
76 |
+#define NO_DEBUG_STR ", NO_DEBUG" |
|
77 |
+#else |
|
78 |
+#define NO_DEBUG_STR "" |
|
79 |
+#endif |
|
80 |
+ |
|
81 |
+#ifdef NO_LOG |
|
82 |
+#define NO_LOG_STR ", NO_LOG" |
|
83 |
+#else |
|
84 |
+#define NO_LOG_STR "" |
|
85 |
+#endif |
|
86 |
+ |
|
87 |
+#ifdef EXTRA_DEBUG |
|
88 |
+#define EXTRA_DEBUG_STR ", EXTRA_DEBUG" |
|
89 |
+#else |
|
90 |
+#define EXTRA_DEBUG_STR "" |
|
91 |
+#endif |
|
92 |
+ |
|
93 |
+#ifdef DNS_IP_HACK |
|
94 |
+#define DNS_IP_HACK_STR ", DNS_IP_HACK" |
|
95 |
+#else |
|
96 |
+#define DNS_IP_HACK_STR "" |
|
97 |
+#endif |
|
98 |
+ |
|
99 |
+#ifdef SHM_MEM |
|
100 |
+#define SHM_MEM_STR ", SHM_MEM" |
|
101 |
+#else |
|
102 |
+#define SHM_MEM_STR "" |
|
103 |
+#endif |
|
104 |
+ |
|
105 |
+#ifdef SHM_MMAP |
|
106 |
+#define SHM_MMAP_STR ", SHM_MMAP" |
|
107 |
+#else |
|
108 |
+#define SHM_MMAP_STR "" |
|
109 |
+#endif |
|
110 |
+ |
|
111 |
+#ifdef PKG_MALLOC |
|
112 |
+#define PKG_MALLOC_STR ", PKG_MALLOC" |
|
113 |
+#else |
|
114 |
+#define PKG_MALLOC_STR "" |
|
115 |
+#endif |
|
116 |
+ |
|
117 |
+#ifdef VQ_MALLOC |
|
118 |
+#define VQ_MALLOC_STR ", VQ_MALLOC" |
|
119 |
+#else |
|
120 |
+#define VQ_MALLOC_STR "" |
|
121 |
+#endif |
|
122 |
+ |
|
123 |
+#ifdef F_MALLOC |
|
124 |
+#define F_MALLOC_STR ", F_MALLOC" |
|
125 |
+#else |
|
126 |
+#define F_MALLOC_STR "" |
|
127 |
+#endif |
|
128 |
+ |
|
129 |
+#ifdef USE_SHM_MEM |
|
130 |
+#define USE_SHM_MEM_STR ", USE_SHM_MEM" |
|
131 |
+#else |
|
132 |
+#define USE_SHM_MEM_STR "" |
|
133 |
+#endif |
|
134 |
+ |
|
135 |
+#ifdef DBG_QM_MALLOC |
|
136 |
+#define DBG_QM_MALLOC_STR ", DBG_QM_MALLOC" |
|
137 |
+#else |
|
138 |
+#define DBG_QM_MALLOC_STR "" |
|
139 |
+#endif |
|
140 |
+ |
|
141 |
+#ifdef DBG_F_MALLOC |
|
142 |
+#define DBG_F_MALLOC_STR ", DBG_F_MALLOC" |
|
143 |
+#else |
|
144 |
+#define DBG_F_MALLOC_STR "" |
|
145 |
+#endif |
|
146 |
+ |
|
147 |
+#ifdef DEBUG_DMALLOC |
|
148 |
+#define DEBUG_DMALLOC_STR ", DEBUG_DMALLOC" |
|
149 |
+#else |
|
150 |
+#define DEBUG_DMALLOC_STR "" |
|
151 |
+#endif |
|
152 |
+ |
|
153 |
+#ifdef FAST_LOCK |
|
154 |
+#ifdef BUSY_WAIT |
|
155 |
+#define FAST_LOCK_STR ", FAST_LOCK-BUSY_WAIT" |
|
156 |
+#elif defined (ADAPTIVE_WAIT) |
|
157 |
+#define FAST_LOCK_STR ", FAST_LOCK-ADAPTIVE_WAIT" |
|
158 |
+#else |
|
159 |
+#define FAST_LOCK_STR ", FAST_LOCK" |
|
160 |
+#endif |
|
161 |
+#else |
|
162 |
+#define FAST_LOCK_STR "" |
|
163 |
+#endif |
|
164 |
+ |
|
165 |
+#ifdef USE_PTHREAD_MUTEX |
|
166 |
+#define USE_PTHREAD_MUTEX_STR ", USE_PTHREAD_MUTEX" |
|
167 |
+#else |
|
168 |
+#define USE_PTHREAD_MUTEX_STR "" |
|
169 |
+#endif |
|
170 |
+ |
|
171 |
+#ifdef USE_POSIX_SEM |
|
172 |
+#define USE_POSIX_SEM_STR ", USE_POSIX_SEM" |
|
173 |
+#else |
|
174 |
+#define USE_POSIX_SEM_STR "" |
|
175 |
+#endif |
|
176 |
+ |
|
177 |
+#ifdef USE_SYSV_SEM |
|
178 |
+#define USE_SYSV_SEM_STR ", USE_SYSV_SEM" |
|
179 |
+#else |
|
180 |
+#define USE_SYSV_SEM_STR "" |
|
181 |
+#endif |
|
182 |
+ |
|
183 |
+ |
|
184 |
+#ifdef NOSMP |
|
185 |
+#define NOSMP_STR "-NOSMP" |
|
186 |
+#else |
|
187 |
+#define NOSMP_STR "" |
|
188 |
+#endif |
|
189 |
+ |
|
190 |
+ |
|
191 |
+#define SER_COMPILE_FLAGS \ |
|
192 |
+ EXTRA_DEBUG_STR STATS_STR USE_IPV6_STR USE_TCP_STR USE_TLS_STR \ |
|
193 |
+ DISABLE_NAGLE_STR USE_MCAST_STR NO_DEBUG_STR NO_LOG_STR DNS_IP_HACK_STR \ |
|
194 |
+ SHM_MEM_STR SHM_MMAP_STR PKG_MALLOC_STR VQ_MALLOC_STR F_MALLOC_STR \ |
|
195 |
+ USE_SHM_MEM_STR DBG_QM_MALLOC_STR DBG_F_MALLOC_STR DEBUG_DMALLOC_STR \ |
|
196 |
+ FAST_LOCK_STR NOSMP_STR USE_PTHREAD_MUTEX_STR USE_POSIX_SEM_STR \ |
|
197 |
+ USE_SYSV_SEM_STR |
|
198 |
+ |
|
199 |
+ |
|
200 |
+#endif |