Browse code

core, lib, modules: restructured source code tree

- new folder src/ to hold the source code for main project applications
- main.c is in src/
- all core files are subfolder are in src/core/
- modules are in src/modules/
- libs are in src/lib/
- application Makefiles are in src/
- application binary is built in src/ (src/kamailio)

Daniel-Constantin Mierla authored on 07/12/2016 11:03:51
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,150 +0,0 @@
1
-/*
2
- * Copyright (C) 2001-2003 FhG Fokus
3
- *
4
- * This file is part of Kamailio, a free SIP server.
5
- *
6
- * Permission to use, copy, modify, and distribute this software for any
7
- * purpose with or without fee is hereby granted, provided that the above
8
- * copyright notice and this permission notice appear in all copies.
9
- *
10
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17
- */
18
-
19
-
20
-#ifdef DBG_QM_MALLOC
21
-
22
-#include <stdio.h>
23
-#include <string.h>
24
-#include <stdlib.h>
25
-
26
-
27
-#include "../globals.h"
28
-#include "../config.h"
29
-
30
-#if 0
31
-#ifdef PKG_MALLOC
32
-#	include "q_malloc.h"
33
-#	define MY_MALLOC qm_malloc
34
-#	define MY_FREE qm_free
35
-#	define MY_INIT qm_malloc_init
36
-#	define MY_BLOCK qm_block
37
-#	define MY_STATUS qm_status
38
-#endif
39
-
40
-void memtest()
41
-{
42
-#define	TEST_SIZE 1024*1024
43
-#define	TEST_RUN 1024
44
-#define LONG_RUN 100000
45
-#define ma(s) MY_MALLOC(mem_block, (s),__FILE__, __FUNCTION__, \
46
-                                                                __LINE__);
47
-#define mf(p)   MY_FREE(mem_block, (p), __FILE__,  __FUNCTION__, \
48
-                                                                __LINE__);
49
-	char tst_mem[TEST_SIZE];
50
-	struct MY_BLOCK* mem_block;
51
-	char *p0,*p1,*p2,*p3,*p4,*p5,*p6/*,*p7,*p8,*p9*/;
52
-	int i, j, f;
53
-	char *p[TEST_RUN];
54
-	int t;
55
-
56
-	debug=7;
57
-	log_stderr=1;
58
-
59
-	printf("entering test\n");
60
-
61
-	mem_block=MY_INIT( tst_mem, TEST_SIZE );
62
-
63
-	/* coalescing test w/big fragments */
64
-	p0=ma(8194);
65
-	p1=ma(8194);
66
-	p2=ma(8194);
67
-	MY_STATUS(mem_block);
68
-	mf(p1);
69
-	mf(p0);
70
-	MY_STATUS(mem_block);
71
-	mf(p2);
72
-	MY_STATUS(mem_block);
73
-
74
-	/* reuse test w/big fragments */
75
-	p0=ma(8194);
76
-	p1=ma(4196);
77
-	mf(p0);
78
-	p0=ma(8190);
79
-	MY_STATUS(mem_block);
80
-	mf(p1);
81
-	mf(p0);
82
-	MY_STATUS(mem_block);
83
-
84
-
85
-	exit(0);
86
-
87
-	p0=ma(8);
88
-	p1=ma(24);
89
-	p2=ma(32);
90
-	p3=ma(32);
91
-	p4=ma(32);
92
-	p5=ma(1024);
93
-	p6=ma(2048);
94
-
95
-//	MY_STATUS(mem_block);
96
-
97
-//	*(p0+9)=0;
98
-	mf(p0);
99
-	mf(p2);
100
-	mf(p5);
101
-	mf(p6);
102
-	
103
-//	MY_STATUS(mem_block);
104
-
105
-	mf(p1);
106
-	mf(p4);
107
-	mf(p3);
108
-//	mf(p3);
109
-
110
-//	MY_STATUS(mem_block);
111
-
112
-	for (i=0;i<TEST_RUN;i++)
113
-		p[i]=ma( random() & 1023 );
114
-//	MY_STATUS(mem_block);
115
-	for (i=0;i<TEST_RUN;i++)
116
-		mf( p[i] );
117
-//	MY_STATUS(mem_block);
118
-
119
-	f = 0;
120
-#define GRANULARITY 100
121
-	for (j=0; j<LONG_RUN; j++) {
122
-		for (i=0;i<TEST_RUN;i++) {
123
-			t=random() & 1023;
124
-			if (! (t%24) ) t=(t+4096)*2;
125
-			p[i]=ma( random() & 1023 );
126
-		}
127
-		for (i=TEST_RUN/3;i<2*TEST_RUN/3;i++)
128
-			mf( p[i] );
129
-		for (i=TEST_RUN/3;i<2*TEST_RUN/3;i++) {
130
-			t=random() & 1023;
131
-			if (! (t%24) ) t=(t+4096)*2;
132
-			p[i]=ma( random() & 1023 );
133
-		}
134
-		for (i=0;i<TEST_RUN;i++)
135
-			mf( p[i] );
136
-		if ( GRANULARITY*j/LONG_RUN > f ) {
137
-			f=GRANULARITY*j/LONG_RUN ;
138
-			printf("%d%% done\n", f);
139
-		}
140
-	}
141
-	printf("now I'm really done\n");
142
-	MY_STATUS(mem_block);
143
-	printf("And I'm done with dumping final report too\n");
144
-	
145
-	exit(0);
146
-}
147
-#endif
148
-
149
-
150
-#endif
Browse code

mem Remove SVN ID, remove history

Olle E. Johansson authored on 25/02/2015 08:12:38
Showing 1 changed files
... ...
@@ -1,9 +1,7 @@
1 1
 /*
2
- * $Id$
3
- *
4 2
  * Copyright (C) 2001-2003 FhG Fokus
5 3
  *
6
- * This file is part of sip-router, a free SIP server.
4
+ * This file is part of Kamailio, a free SIP server.
7 5
  *
8 6
  * Permission to use, copy, modify, and distribute this software for any
9 7
  * purpose with or without fee is hereby granted, provided that the above
Browse code

core: mem dbg options updates + cleanups

- memlog and memdbg can now be changed at runtime
- double define warning fix for fm_malloc (when compiled with -DF_MALLOC)
- nicer qm_status() & qm_sums() output
- BSD licence for mem/*

Andrei Pelinescu-Onciul authored on 29/09/2009 13:25:50
Showing 1 changed files
... ...
@@ -3,26 +3,19 @@
3 3
  *
4 4
  * Copyright (C) 2001-2003 FhG Fokus
5 5
  *
6
- * This file is part of ser, a free SIP server.
6
+ * This file is part of sip-router, a free SIP server.
7 7
  *
8
- * ser is free software; you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License as published by
10
- * the Free Software Foundation; either version 2 of the License, or
11
- * (at your option) any later version
8
+ * Permission to use, copy, modify, and distribute this software for any
9
+ * purpose with or without fee is hereby granted, provided that the above
10
+ * copyright notice and this permission notice appear in all copies.
12 11
  *
13
- * For a license to use the ser software under conditions
14
- * other than those described here, or to purchase support for this
15
- * software, please contact iptel.org by e-mail at the following addresses:
16
- *    info@iptel.org
17
- *
18
- * ser is distributed in the hope that it will be useful,
19
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
- * GNU General Public License for more details.
22
- *
23
- * You should have received a copy of the GNU General Public License 
24
- * along with this program; if not, write to the Free Software 
25
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
12
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
15
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
26 19
  */
27 20
 
28 21
 
Browse code

core: remove VQ_MALLOC memory manager

attached patch removes the VQ_MALLOC memory manager from the
sip-router core. As discussed some time ago, this memory manager
doesn't provide a realloc implementation, and is thus not really
usable for the modules, as some of them needs this. We removed
this in kamailio in the last year, so far nobody missed it.

Signed-off-by: Andrei Pelinescu-Onciul <andrei@iptel.org>

Henning Westerholt authored on 17/03/2009 12:24:42 • Andrei Pelinescu-Onciul committed on 29/09/2009 17:03:41
Showing 1 changed files
... ...
@@ -38,21 +38,12 @@
38 38
 
39 39
 #if 0
40 40
 #ifdef PKG_MALLOC
41
-#       ifdef VQ_MALLOC
42
-#               include "vq_malloc.h"
43
-#		define MY_MALLOC vqm_malloc
44
-#		define MY_FREE vqm_free
45
-#		define MY_INIT vqm_malloc_init
46
-#		define MY_BLOCK vqm_block
47
-#		define MY_STATUS vqm_status
48
-#       else
49
-#               include "q_malloc.h"
50
-#		define MY_MALLOC qm_malloc
51
-#		define MY_FREE qm_free
52
-#		define MY_INIT qm_malloc_init
53
-#		define MY_BLOCK qm_block
54
-#		define MY_STATUS qm_status
55
-#       endif
41
+#	include "q_malloc.h"
42
+#	define MY_MALLOC qm_malloc
43
+#	define MY_FREE qm_free
44
+#	define MY_INIT qm_malloc_init
45
+#	define MY_BLOCK qm_block
46
+#	define MY_STATUS qm_status
56 47
 #endif
57 48
 
58 49
 void memtest()
Browse code

- Spelling checked - READMEs updated

Jan Janak authored on 24/08/2004 08:58:23
Showing 1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * $Id$
3 3
  *
4
- * Copyright (C) 2001-2003 Fhg Fokus
4
+ * Copyright (C) 2001-2003 FhG Fokus
5 5
  *
6 6
  * This file is part of ser, a free SIP server.
7 7
  *
... ...
@@ -78,7 +78,7 @@ void memtest()
78 78
 
79 79
 	mem_block=MY_INIT( tst_mem, TEST_SIZE );
80 80
 
81
-	/* coalesing test w/big fragments */
81
+	/* coalescing test w/big fragments */
82 82
 	p0=ma(8194);
83 83
 	p1=ma(8194);
84 84
 	p2=ma(8194);
Browse code

GPLization banner introduced to *.[hc] files

Jiri Kuthan authored on 19/09/2002 12:23:52
Showing 1 changed files
... ...
@@ -1,7 +1,31 @@
1 1
 /*
2 2
  * $Id$
3
+ *
4
+ * Copyright (C) 2001-2003 Fhg Fokus
5
+ *
6
+ * This file is part of ser, a free SIP server.
7
+ *
8
+ * ser is free software; you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation; either version 2 of the License, or
11
+ * (at your option) any later version
12
+ *
13
+ * For a license to use the ser software under conditions
14
+ * other than those described here, or to purchase support for this
15
+ * software, please contact iptel.org by e-mail at the following addresses:
16
+ *    info@iptel.org
17
+ *
18
+ * ser is distributed in the hope that it will be useful,
19
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
+ * GNU General Public License for more details.
22
+ *
23
+ * You should have received a copy of the GNU General Public License 
24
+ * along with this program; if not, write to the Free Software 
25
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
3 26
  */
4 27
 
28
+
5 29
 #ifdef DBG_QM_MALLOC
6 30
 
7 31
 #include <stdio.h>
Browse code

CVS substitutes introduced

Jiri Kuthan authored on 19/09/2002 11:51:26
Showing 1 changed files
... ...
@@ -1,3 +1,7 @@
1
+/*
2
+ * $Id$
3
+ */
4
+
1 5
 #ifdef DBG_QM_MALLOC
2 6
 
3 7
 #include <stdio.h>
Browse code

bignag change -- lot of things primarily added in relationship with refurbushing TM; see [sr] archive (2002-08-14) -- "ser update" and "TM update" for a long list of details

Jiri Kuthan authored on 15/08/2002 08:13:29
Showing 1 changed files
... ...
@@ -1,5 +1,10 @@
1 1
 #ifdef DBG_QM_MALLOC
2 2
 
3
+#include <stdio.h>
4
+#include <string.h>
5
+#include <stdlib.h>
6
+
7
+
3 8
 #include "../globals.h"
4 9
 #include "../config.h"
5 10
 
... ...
@@ -33,7 +38,7 @@ void memtest()
33 38
                                                                 __LINE__);
34 39
 	char tst_mem[TEST_SIZE];
35 40
 	struct MY_BLOCK* mem_block;
36
-	char *p0,*p1,*p2,*p3,*p4,*p5,*p6,*p7,*p8,*p9;
41
+	char *p0,*p1,*p2,*p3,*p4,*p5,*p6/*,*p7,*p8,*p9*/;
37 42
 	int i, j, f;
38 43
 	char *p[TEST_RUN];
39 44
 	int t;
Browse code

- ipv6 received= debugging

Andrei Pelinescu-Onciul authored on 08/07/2002 16:27:04
Showing 1 changed files
... ...
@@ -3,6 +3,7 @@
3 3
 #include "../globals.h"
4 4
 #include "../config.h"
5 5
 
6
+#if 0
6 7
 #ifdef PKG_MALLOC
7 8
 #       ifdef VQ_MALLOC
8 9
 #               include "vq_malloc.h"
... ...
@@ -21,7 +22,6 @@
21 22
 #       endif
22 23
 #endif
23 24
 
24
-
25 25
 void memtest()
26 26
 {
27 27
 #define	TEST_SIZE 1024*1024
... ...
@@ -129,5 +129,7 @@ void memtest()
129 129
 	
130 130
 	exit(0);
131 131
 }
132
+#endif
133
+
132 134
 
133 135
 #endif
Browse code

performance and bug fixes

Jiri Kuthan authored on 07/01/2002 04:39:49
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,133 @@
1
+#ifdef DBG_QM_MALLOC
2
+
3
+#include "../globals.h"
4
+#include "../config.h"
5
+
6
+#ifdef PKG_MALLOC
7
+#       ifdef VQ_MALLOC
8
+#               include "vq_malloc.h"
9
+#		define MY_MALLOC vqm_malloc
10
+#		define MY_FREE vqm_free
11
+#		define MY_INIT vqm_malloc_init
12
+#		define MY_BLOCK vqm_block
13
+#		define MY_STATUS vqm_status
14
+#       else
15
+#               include "q_malloc.h"
16
+#		define MY_MALLOC qm_malloc
17
+#		define MY_FREE qm_free
18
+#		define MY_INIT qm_malloc_init
19
+#		define MY_BLOCK qm_block
20
+#		define MY_STATUS qm_status
21
+#       endif
22
+#endif
23
+
24
+
25
+void memtest()
26
+{
27
+#define	TEST_SIZE 1024*1024
28
+#define	TEST_RUN 1024
29
+#define LONG_RUN 100000
30
+#define ma(s) MY_MALLOC(mem_block, (s),__FILE__, __FUNCTION__, \
31
+                                                                __LINE__);
32
+#define mf(p)   MY_FREE(mem_block, (p), __FILE__,  __FUNCTION__, \
33
+                                                                __LINE__);
34
+	char tst_mem[TEST_SIZE];
35
+	struct MY_BLOCK* mem_block;
36
+	char *p0,*p1,*p2,*p3,*p4,*p5,*p6,*p7,*p8,*p9;
37
+	int i, j, f;
38
+	char *p[TEST_RUN];
39
+	int t;
40
+
41
+	debug=7;
42
+	log_stderr=1;
43
+
44
+	printf("entering test\n");
45
+
46
+	mem_block=MY_INIT( tst_mem, TEST_SIZE );
47
+
48
+	/* coalesing test w/big fragments */
49
+	p0=ma(8194);
50
+	p1=ma(8194);
51
+	p2=ma(8194);
52
+	MY_STATUS(mem_block);
53
+	mf(p1);
54
+	mf(p0);
55
+	MY_STATUS(mem_block);
56
+	mf(p2);
57
+	MY_STATUS(mem_block);
58
+
59
+	/* reuse test w/big fragments */
60
+	p0=ma(8194);
61
+	p1=ma(4196);
62
+	mf(p0);
63
+	p0=ma(8190);
64
+	MY_STATUS(mem_block);
65
+	mf(p1);
66
+	mf(p0);
67
+	MY_STATUS(mem_block);
68
+
69
+
70
+	exit(0);
71
+
72
+	p0=ma(8);
73
+	p1=ma(24);
74
+	p2=ma(32);
75
+	p3=ma(32);
76
+	p4=ma(32);
77
+	p5=ma(1024);
78
+	p6=ma(2048);
79
+
80
+//	MY_STATUS(mem_block);
81
+
82
+//	*(p0+9)=0;
83
+	mf(p0);
84
+	mf(p2);
85
+	mf(p5);
86
+	mf(p6);
87
+	
88
+//	MY_STATUS(mem_block);
89
+
90
+	mf(p1);
91
+	mf(p4);
92
+	mf(p3);
93
+//	mf(p3);
94
+
95
+//	MY_STATUS(mem_block);
96
+
97
+	for (i=0;i<TEST_RUN;i++)
98
+		p[i]=ma( random() & 1023 );
99
+//	MY_STATUS(mem_block);
100
+	for (i=0;i<TEST_RUN;i++)
101
+		mf( p[i] );
102
+//	MY_STATUS(mem_block);
103
+
104
+	f = 0;
105
+#define GRANULARITY 100
106
+	for (j=0; j<LONG_RUN; j++) {
107
+		for (i=0;i<TEST_RUN;i++) {
108
+			t=random() & 1023;
109
+			if (! (t%24) ) t=(t+4096)*2;
110
+			p[i]=ma( random() & 1023 );
111
+		}
112
+		for (i=TEST_RUN/3;i<2*TEST_RUN/3;i++)
113
+			mf( p[i] );
114
+		for (i=TEST_RUN/3;i<2*TEST_RUN/3;i++) {
115
+			t=random() & 1023;
116
+			if (! (t%24) ) t=(t+4096)*2;
117
+			p[i]=ma( random() & 1023 );
118
+		}
119
+		for (i=0;i<TEST_RUN;i++)
120
+			mf( p[i] );
121
+		if ( GRANULARITY*j/LONG_RUN > f ) {
122
+			f=GRANULARITY*j/LONG_RUN ;
123
+			printf("%d%% done\n", f);
124
+		}
125
+	}
126
+	printf("now I'm really done\n");
127
+	MY_STATUS(mem_block);
128
+	printf("And I'm done with dumping final report too\n");
129
+	
130
+	exit(0);
131
+}
132
+
133
+#endif