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,124 +0,0 @@
1
-/*
2
- * circular list maintenance macros
3
- *
4
- * Copyright (C) 2005 iptelorg GmbH
5
- *
6
- * This file is part of Kamailio, a free SIP server.
7
- *
8
- * Kamailio 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
- * Kamailio is distributed in the hope that it will be useful,
14
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
- * GNU General Public License for more details.
17
- *
18
- * You should have received a copy of the GNU General Public License 
19
- * along with this program; if not, write to the Free Software 
20
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
21
- */
22
-
23
-/*!
24
- * \file
25
- * \brief Kamailio core :: circular list maintenance macros
26
- *
27
- * \author andrei
28
- * \ingroup core
29
- * Module: \ref core
30
- */
31
-
32
-
33
-#ifndef _clist_h
34
-#define _clist_h
35
-
36
-/*! \brief circular list */
37
-#define clist_init(c, next, prev) \
38
-	do{ \
39
-		(c)->next=(void*)(c); \
40
-		(c)->prev=(void*)(c); \
41
-	} while(0)
42
-
43
-
44
-
45
-/*! \brief adds an entire sublist { s,e } (including s & e )
46
- * after head
47
- *
48
- * \note WARNING: clist_insert_sublist(head, n, n->prev) won't work,
49
- *          same for clist_insert_sublist(head, n->next, n)
50
- *  (macro!), use  e=n->prev; clist_insert_sublist(head, n, e, ...)
51
- *  instead!
52
- */
53
-#define clist_insert_sublist(head, s, e, next, prev) \
54
-	do{ \
55
-		(s)->prev=(void*)(head); \
56
-		(e)->next=(head)->next; \
57
-		(e)->next->prev=(e); \
58
-		(head)->next=s;   \
59
-	}while(0)
60
-
61
-
62
-
63
-/*! \brief appends an entire sublist { s,e } (including s & e )
64
- * at the end of the list
65
- *
66
- * WARNING: clist_append_sublist(head, n, n->prev, ...) won't work,
67
- *  (macro!), use  e=n->prev; clist_append_sublist(head, n, e, ...)
68
- *  instead!
69
- */
70
-#define clist_append_sublist(head, s, e, next, prev) \
71
-	do{ \
72
-		(s)->prev=(head)->prev; \
73
-		(e)->next=(void*)(head); \
74
-		(s)->prev->next=(s); \
75
-		(head)->prev=(e);   \
76
-	}while(0)
77
-
78
-
79
-
80
-
81
-/*! \brief remove sublist { s,e } (including s & e )
82
- * always, if start is the beginning of the list use
83
- * clist_rm_sublist(head->next, e, next, prev )
84
- * WARNING: clist_rm_sublist(n, n->prev, ...) won't work,
85
- *  (macro!), use  e=n->prev; clist_rm_sublist(n, e, ...)
86
- *  instead! */
87
-#define clist_rm_sublist(s, e, next, prev) \
88
-	do{\
89
-		(s)->prev->next=(e)->next;  \
90
-		(e)->next->prev=(s)->prev;  \
91
-		(s)->prev=NULL; \
92
-		(e)->next=NULL; \
93
-	}while(0)
94
-
95
-
96
-
97
-/*! \brief insert after (head) */
98
-#define clist_insert(head, c, next, prev) \
99
-	clist_insert_sublist(head, c, c, next, prev)
100
-
101
-
102
-
103
-/*! \brief  append at the end of the list (head->prev) */
104
-#define clist_append(head, c, next, prev) \
105
-	clist_append_sublist(head, c, c, next, prev)
106
-
107
-
108
-
109
-/*! \brief  remove and element */
110
-#define clist_rm(c, next, prev) \
111
-	clist_rm_sublist(c, c, next, prev)
112
-
113
-
114
-
115
-/*! \brief  iterate on a clist */
116
-#define clist_foreach(head, v, dir) \
117
-	for((v)=(head)->dir; (v)!=(void*)(head); (v)=(v)->dir)
118
-
119
-/*! \brief  iterate on a clist, safe version (requires an extra bak. var)
120
- * (it allows removing of the current element) */
121
-#define clist_foreach_safe(head, v, bak,  dir) \
122
-	for((v)=(head)->dir, (bak)=(v)->dir; (v)!=(void*)(head); \
123
-				(v)=(bak), (bak)=(v)->dir)
124
-#endif
Browse code

core: clist - restet prev/next when removing from clist slot

Daniel-Constantin Mierla authored on 05/11/2015 07:51:25
Showing 1 changed files
... ...
@@ -87,7 +87,9 @@
87 87
 #define clist_rm_sublist(s, e, next, prev) \
88 88
 	do{\
89 89
 		(s)->prev->next=(e)->next;  \
90
-		(e)->next->prev=(s)->prev ; \
90
+		(e)->next->prev=(s)->prev;  \
91
+		(s)->prev=NULL; \
92
+		(e)->next=NULL; \
91 93
 	}while(0)
92 94
 
93 95
 
Browse code

core : Update include files - delete IDs, update doxygen, delete history

Olle E. Johansson authored on 03/01/2015 10:55:48
Showing 1 changed files
... ...
@@ -1,18 +1,16 @@
1 1
 /*
2
- * $Id$
3
- *
4 2
  * circular list maintenance macros
5 3
  *
6 4
  * Copyright (C) 2005 iptelorg GmbH
7 5
  *
8
- * This file is part of ser, a free SIP server.
6
+ * This file is part of Kamailio, a free SIP server.
9 7
  *
10
- * ser is free software; you can redistribute it and/or modify
8
+ * Kamailio is free software; you can redistribute it and/or modify
11 9
  * it under the terms of the GNU General Public License as published by
12 10
  * the Free Software Foundation; either version 2 of the License, or
13 11
  * (at your option) any later version
14 12
  *
15
- * ser is distributed in the hope that it will be useful,
13
+ * Kamailio is distributed in the hope that it will be useful,
16 14
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 15
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 16
  * GNU General Public License for more details.
... ...
@@ -24,16 +22,13 @@
24 22
 
25 23
 /*!
26 24
  * \file
27
- * \brief SIP-router core :: circular list maintenance macros
25
+ * \brief Kamailio core :: circular list maintenance macros
28 26
  *
27
+ * \author andrei
29 28
  * \ingroup core
30 29
  * Module: \ref core
31 30
  */
32 31
 
33
-/* History:
34
- * --------
35
- *  2005-08-08  created by andrei
36
- */
37 32
 
38 33
 #ifndef _clist_h
39 34
 #define _clist_h
Browse code

all: updated FSF address in GPL text

Anthony Messina authored on 04/07/2014 09:36:37 • Daniel-Constantin Mierla committed on 04/07/2014 09:37:36
Showing 1 changed files
... ...
@@ -19,7 +19,7 @@
19 19
  *
20 20
  * You should have received a copy of the GNU General Public License 
21 21
  * along with this program; if not, write to the Free Software 
22
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
22
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
23 23
  */
24 24
 
25 25
 /*!
Browse code

clist.h Rever last changes

Wrong casts

Anca Vamanu authored on 17/01/2012 14:23:17
Showing 1 changed files
... ...
@@ -41,8 +41,8 @@
41 41
 /*! \brief circular list */
42 42
 #define clist_init(c, next, prev) \
43 43
 	do{ \
44
-		(c)->next=(struct str_hash_entry*)(void*)(c); \
45
-		(c)->prev=(struct str_hash_entry*)(void*)(c); \
44
+		(c)->next=(void*)(c); \
45
+		(c)->prev=(void*)(c); \
46 46
 	} while(0)
47 47
 
48 48
 
... ...
@@ -57,7 +57,7 @@
57 57
  */
58 58
 #define clist_insert_sublist(head, s, e, next, prev) \
59 59
 	do{ \
60
-		(s)->prev=(struct str_hash_entry*)(void*)(head); \
60
+		(s)->prev=(void*)(head); \
61 61
 		(e)->next=(head)->next; \
62 62
 		(e)->next->prev=(e); \
63 63
 		(head)->next=s;   \
... ...
@@ -91,8 +91,8 @@
91 91
  *  instead! */
92 92
 #define clist_rm_sublist(s, e, next, prev) \
93 93
 	do{\
94
-		(s)->prev->next=(struct str_hash_entry*)(e)->next;  \
95
-		(e)->next->prev=(struct str_hash_entry*)(s)->prev ; \
94
+		(s)->prev->next=(e)->next;  \
95
+		(e)->next->prev=(s)->prev ; \
96 96
 	}while(0)
97 97
 
98 98
 
Browse code

Fixed compile warnings - casts from void at memory allocation

Anca Vamanu authored on 17/01/2012 09:02:50
Showing 1 changed files
... ...
@@ -41,8 +41,8 @@
41 41
 /*! \brief circular list */
42 42
 #define clist_init(c, next, prev) \
43 43
 	do{ \
44
-		(c)->next=(void*)(c); \
45
-		(c)->prev=(void*)(c); \
44
+		(c)->next=(struct str_hash_entry*)(void*)(c); \
45
+		(c)->prev=(struct str_hash_entry*)(void*)(c); \
46 46
 	} while(0)
47 47
 
48 48
 
... ...
@@ -57,7 +57,7 @@
57 57
  */
58 58
 #define clist_insert_sublist(head, s, e, next, prev) \
59 59
 	do{ \
60
-		(s)->prev=(void*)(head); \
60
+		(s)->prev=(struct str_hash_entry*)(void*)(head); \
61 61
 		(e)->next=(head)->next; \
62 62
 		(e)->next->prev=(e); \
63 63
 		(head)->next=s;   \
... ...
@@ -91,8 +91,8 @@
91 91
  *  instead! */
92 92
 #define clist_rm_sublist(s, e, next, prev) \
93 93
 	do{\
94
-		(s)->prev->next=(e)->next;  \
95
-		(e)->next->prev=(s)->prev ; \
94
+		(s)->prev->next=(struct str_hash_entry*)(e)->next;  \
95
+		(e)->next->prev=(struct str_hash_entry*)(s)->prev ; \
96 96
 	}while(0)
97 97
 
98 98
 
Browse code

Doxygen updates

oej authored on 25/10/2009 19:11:28
Showing 1 changed files
... ...
@@ -12,11 +12,6 @@
12 12
  * the Free Software Foundation; either version 2 of the License, or
13 13
  * (at your option) any later version
14 14
  *
15
- * For a license to use the ser software under conditions
16
- * other than those described here, or to purchase support for this
17
- * software, please contact iptel.org by e-mail at the following addresses:
18
- *    info@iptel.org
19
- *
20 15
  * ser is distributed in the hope that it will be useful,
21 16
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 17
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
... ...
@@ -43,7 +38,7 @@
43 38
 #ifndef _clist_h
44 39
 #define _clist_h
45 40
 
46
-/* circular list */
41
+/*! \brief circular list */
47 42
 #define clist_init(c, next, prev) \
48 43
 	do{ \
49 44
 		(c)->next=(void*)(c); \
Browse code

- Doxygen updates on core files - Add project name to doxygen in Makefile

oej authored on 19/10/2009 20:35:43
Showing 1 changed files
... ...
@@ -27,6 +27,14 @@
27 27
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
28 28
  */
29 29
 
30
+/*!
31
+ * \file
32
+ * \brief SIP-router core :: circular list maintenance macros
33
+ *
34
+ * \ingroup core
35
+ * Module: \ref core
36
+ */
37
+
30 38
 /* History:
31 39
  * --------
32 40
  *  2005-08-08  created by andrei
... ...
@@ -44,9 +52,10 @@
44 52
 
45 53
 
46 54
 
47
-/* adds an entire sublist { s,e } (including s & e )
55
+/*! \brief adds an entire sublist { s,e } (including s & e )
48 56
  * after head
49
- * WARNING: clist_insert_sublist(head, n, n->prev) won't work,
57
+ *
58
+ * \note WARNING: clist_insert_sublist(head, n, n->prev) won't work,
50 59
  *          same for clist_insert_sublist(head, n->next, n)
51 60
  *  (macro!), use  e=n->prev; clist_insert_sublist(head, n, e, ...)
52 61
  *  instead!
... ...
@@ -61,8 +70,9 @@
61 70
 
62 71
 
63 72
 
64
-/* appends an entire sublist { s,e } (including s & e )
73
+/*! \brief appends an entire sublist { s,e } (including s & e )
65 74
  * at the end of the list
75
+ *
66 76
  * WARNING: clist_append_sublist(head, n, n->prev, ...) won't work,
67 77
  *  (macro!), use  e=n->prev; clist_append_sublist(head, n, e, ...)
68 78
  *  instead!
... ...
@@ -78,7 +88,7 @@
78 88
 
79 89
 
80 90
 
81
-/* remove sublist { s,e } (including s & e )
91
+/*! \brief remove sublist { s,e } (including s & e )
82 92
  * always, if start is the beginning of the list use
83 93
  * clist_rm_sublist(head->next, e, next, prev )
84 94
  * WARNING: clist_rm_sublist(n, n->prev, ...) won't work,
... ...
@@ -92,29 +102,29 @@
92 102
 
93 103
 
94 104
 
95
-/* insert after (head) */
105
+/*! \brief insert after (head) */
96 106
 #define clist_insert(head, c, next, prev) \
97 107
 	clist_insert_sublist(head, c, c, next, prev)
98 108
 
99 109
 
100 110
 
101
-/* append at the end of the list (head->prev) */
111
+/*! \brief  append at the end of the list (head->prev) */
102 112
 #define clist_append(head, c, next, prev) \
103 113
 	clist_append_sublist(head, c, c, next, prev)
104 114
 
105 115
 
106 116
 
107
-/* remove and element */
117
+/*! \brief  remove and element */
108 118
 #define clist_rm(c, next, prev) \
109 119
 	clist_rm_sublist(c, c, next, prev)
110 120
 
111 121
 
112 122
 
113
-/* iterate on a clist */
123
+/*! \brief  iterate on a clist */
114 124
 #define clist_foreach(head, v, dir) \
115 125
 	for((v)=(head)->dir; (v)!=(void*)(head); (v)=(v)->dir)
116 126
 
117
-/* iterate on a clist, safe version (requires an extra bak. var)
127
+/*! \brief  iterate on a clist, safe version (requires an extra bak. var)
118 128
  * (it allows removing of the current element) */
119 129
 #define clist_foreach_safe(head, v, bak,  dir) \
120 130
 	for((v)=(head)->dir, (bak)=(v)->dir; (v)!=(void*)(head); \
Browse code

- dns cache support (ser will cache both positive and negative responses if turned on, see doc/dns.txt for more details & config options) - dns failover support: when a name resolves to more then 1 ip (either multiple A or AAAA records or multiple SRVs) and sending to the first ip fails, ser will retry with the others. By default is off. See doc/dns.txt for more details/config options a.s.o. - destination blacklist: when sending to some destination (defined by ip:port and protocol) fails, ser will temporarily add this destination in a blacklist giving future sends the opportunity of immediately failing. Destination are also added to the blacklist on tm invite timeouts (when no response is received in the fr_timer interval). By default is off, see doc/dst_blacklist.txt form more details/config options. - small makefile fixes (in mode=debug) - resolver get_record api changes (updated enum)

WARNING: there are a lot of changes in tm

Andrei Pelinescu-Onciul authored on 15/09/2006 10:37:44
Showing 1 changed files
... ...
@@ -46,6 +46,10 @@
46 46
 
47 47
 /* adds an entire sublist { s,e } (including s & e )
48 48
  * after head
49
+ * WARNING: clist_insert_sublist(head, n, n->prev) won't work,
50
+ *          same for clist_insert_sublist(head, n->next, n)
51
+ *  (macro!), use  e=n->prev; clist_insert_sublist(head, n, e, ...)
52
+ *  instead!
49 53
  */
50 54
 #define clist_insert_sublist(head, s, e, next, prev) \
51 55
 	do{ \
... ...
@@ -59,6 +63,9 @@
59 63
 
60 64
 /* appends an entire sublist { s,e } (including s & e )
61 65
  * at the end of the list
66
+ * WARNING: clist_append_sublist(head, n, n->prev, ...) won't work,
67
+ *  (macro!), use  e=n->prev; clist_append_sublist(head, n, e, ...)
68
+ *  instead!
62 69
  */
63 70
 #define clist_append_sublist(head, s, e, next, prev) \
64 71
 	do{ \
... ...
@@ -70,9 +77,13 @@
70 77
 
71 78
 
72 79
 
80
+
73 81
 /* remove sublist { s,e } (including s & e )
74 82
  * always, if start is the beginning of the list use
75
- * clist_rm_sublist(head->next, e, next, prev ) */
83
+ * clist_rm_sublist(head->next, e, next, prev )
84
+ * WARNING: clist_rm_sublist(n, n->prev, ...) won't work,
85
+ *  (macro!), use  e=n->prev; clist_rm_sublist(n, e, ...)
86
+ *  instead! */
76 87
 #define clist_rm_sublist(s, e, next, prev) \
77 88
 	do{\
78 89
 		(s)->prev->next=(e)->next;  \
Browse code

- more generic hash functions - named flags support: the flags can now have names Example: flags a, b:6, test_flag; # b is set to the 6 flag, the rest are # allocated automatically route{ setflag(test_flag); ... }

Andrei Pelinescu-Onciul authored on 02/02/2006 19:29:21
Showing 1 changed files
... ...
@@ -49,7 +49,7 @@
49 49
  */
50 50
 #define clist_insert_sublist(head, s, e, next, prev) \
51 51
 	do{ \
52
-		(s)->prev=(head); \
52
+		(s)->prev=(void*)(head); \
53 53
 		(e)->next=(head)->next; \
54 54
 		(e)->next->prev=(e); \
55 55
 		(head)->next=s;   \
Browse code

New timer interface: - allows adding timers dynamically - supports one shot and periodic timers - precise - allows timeouts < 0.5 s (depends on the config., by default min. timeout = 62.5 ms) - based on a 3 level hierarchical timing wheel - very fast - low overhead for timer functions (most of the time, the excetion is timer_del which take can take quite a long time in special situations) - supports "slow" timers (compile option, by default on), "slow" timer = a timer handler which is declared as possible taking a long timer to execute. - backward compatible: old timer functions are preserverd => no changes needed for the existing code (although migration to the new interface is recommended) For more information read doc/timers.txt. tm timer update will follow shortly (this week).

Andrei Pelinescu-Onciul authored on 05/12/2005 18:29:30
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,111 @@
1
+/*
2
+ * $Id$
3
+ *
4
+ * circular list maintenance macros
5
+ *
6
+ * Copyright (C) 2005 iptelorg GmbH
7
+ *
8
+ * This file is part of ser, a free SIP server.
9
+ *
10
+ * ser is free software; you can redistribute it and/or modify
11
+ * it under the terms of the GNU General Public License as published by
12
+ * the Free Software Foundation; either version 2 of the License, or
13
+ * (at your option) any later version
14
+ *
15
+ * For a license to use the ser software under conditions
16
+ * other than those described here, or to purchase support for this
17
+ * software, please contact iptel.org by e-mail at the following addresses:
18
+ *    info@iptel.org
19
+ *
20
+ * ser is distributed in the hope that it will be useful,
21
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23
+ * GNU General Public License for more details.
24
+ *
25
+ * You should have received a copy of the GNU General Public License 
26
+ * along with this program; if not, write to the Free Software 
27
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
28
+ */
29
+
30
+/* History:
31
+ * --------
32
+ *  2005-08-08  created by andrei
33
+ */
34
+
35
+#ifndef _clist_h
36
+#define _clist_h
37
+
38
+/* circular list */
39
+#define clist_init(c, next, prev) \
40
+	do{ \
41
+		(c)->next=(void*)(c); \
42
+		(c)->prev=(void*)(c); \
43
+	} while(0)
44
+
45
+
46
+
47
+/* adds an entire sublist { s,e } (including s & e )
48
+ * after head
49
+ */
50
+#define clist_insert_sublist(head, s, e, next, prev) \
51
+	do{ \
52
+		(s)->prev=(head); \
53
+		(e)->next=(head)->next; \
54
+		(e)->next->prev=(e); \
55
+		(head)->next=s;   \
56
+	}while(0)
57
+
58
+
59
+
60
+/* appends an entire sublist { s,e } (including s & e )
61
+ * at the end of the list
62
+ */
63
+#define clist_append_sublist(head, s, e, next, prev) \
64
+	do{ \
65
+		(s)->prev=(head)->prev; \
66
+		(e)->next=(void*)(head); \
67
+		(s)->prev->next=(s); \
68
+		(head)->prev=(e);   \
69
+	}while(0)
70
+
71
+
72
+
73
+/* remove sublist { s,e } (including s & e )
74
+ * always, if start is the beginning of the list use
75
+ * clist_rm_sublist(head->next, e, next, prev ) */
76
+#define clist_rm_sublist(s, e, next, prev) \
77
+	do{\
78
+		(s)->prev->next=(e)->next;  \
79
+		(e)->next->prev=(s)->prev ; \
80
+	}while(0)
81
+
82
+
83
+
84
+/* insert after (head) */
85
+#define clist_insert(head, c, next, prev) \
86
+	clist_insert_sublist(head, c, c, next, prev)
87
+
88
+
89
+
90
+/* append at the end of the list (head->prev) */
91
+#define clist_append(head, c, next, prev) \
92
+	clist_append_sublist(head, c, c, next, prev)
93
+
94
+
95
+
96
+/* remove and element */
97
+#define clist_rm(c, next, prev) \
98
+	clist_rm_sublist(c, c, next, prev)
99
+
100
+
101
+
102
+/* iterate on a clist */
103
+#define clist_foreach(head, v, dir) \
104
+	for((v)=(head)->dir; (v)!=(void*)(head); (v)=(v)->dir)
105
+
106
+/* iterate on a clist, safe version (requires an extra bak. var)
107
+ * (it allows removing of the current element) */
108
+#define clist_foreach_safe(head, v, bak,  dir) \
109
+	for((v)=(head)->dir, (bak)=(v)->dir; (v)!=(void*)(head); \
110
+				(v)=(bak), (bak)=(v)->dir)
111
+#endif