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,115 +0,0 @@
1
-/*
2
- * Copyright (C) 2001-2003 FhG Fokus
3
- *
4
- * This file is part of Kamailio, a free SIP server.
5
- *
6
- * Kamailio is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation; either version 2 of the License, or
9
- * (at your option) any later version
10
- *
11
- * Kamailio is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
- * GNU General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU General Public License 
17
- * along with this program; if not, write to the Free Software 
18
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
19
- */
20
-
21
-/**
22
- * @file
23
- * @brief TM :: Message cloning functionality
24
- * 
25
- * Cloning a message into shared memory (TM keeps a snapshot
26
- * of messages in memory); note that many operations, which
27
- * allocate pkg memory (such as parsing) cannot be used with
28
- * a cloned message -- it would result in linking pkg structures
29
- * to shmem msg and eventually in a memory error.
30
- * 
31
- * The cloned message is stored in a single memory fragment to
32
- * save too many shm_mallocs -- these are expensive as they
33
- * not only take lookup in fragment table but also a shmem lock
34
- * operation (the same for shm_free)
35
- * 
36
- * Allow postponing the cloning of SIP msg:
37
- * t_newtran() copies the requests to shm mem without the lumps,
38
- * and t_forward_nonack() clones the lumps later when it is called
39
- * the first time.
40
- * @ingroup tm
41
- */
42
-
43
-#ifndef _SIP_MSG_H
44
-#define _SIP_MSG_H
45
-
46
-#include "defs.h"
47
-
48
-
49
-#include "../../parser/msg_parser.h"
50
-#include "../../mem/shm_mem.h"
51
-
52
-
53
-#include "../../atomic_ops.h" /* membar_depends() */
54
-
55
-/**
56
- * @brief Helper function to free a SIP message
57
- * 
58
- * msg is a reply: one memory block was allocated
59
- * 
60
- * msg is a request: two memory blocks were allocated:
61
- * - one for the sip_msg struct
62
- * - another one for the lumps which is linked to add_rm, body_lumps,
63
- *   or reply_lump
64
- */
65
-#define  _sip_msg_free(_free_func, _p_msg) \
66
-		do{ \
67
-			if (_p_msg->first_line.type==SIP_REPLY) { \
68
-				_free_func( (_p_msg) ); \
69
-			} else { \
70
-				membar_depends(); \
71
-				if ((_p_msg)->add_rm) \
72
-					_free_func((_p_msg)->add_rm); \
73
-				else if ((_p_msg)->body_lumps) \
74
-					_free_func((_p_msg)->body_lumps); \
75
-				else if ((_p_msg)->reply_lump) \
76
-					_free_func((_p_msg)->reply_lump); \
77
-									  \
78
-				_free_func( (_p_msg) ); \
79
-			} \
80
-		}while(0)
81
-
82
-
83
-/**
84
- * @brief Free a SIP message safely, with locking
85
- */
86
-#define  sip_msg_free(_p_msg) _sip_msg_free(shm_free, _p_msg)
87
-/**
88
- * @brief Free a SIP message unsafely, without locking
89
- */
90
-#define  sip_msg_free_unsafe(_p_msg) _sip_msg_free(shm_free_unsafe, _p_msg)
91
-
92
-/**
93
- * @brief Clone a SIP message
94
- * @warning Cloner does not clone all hdr_field headers (From, To, etc.). Pointers will reference pkg memory. Dereferencing will crash ser!
95
- * @param org_msg Original SIP message
96
- * @param sip_msg_len Length of the SIP message
97
- * @return Cloned SIP message, or NULL on error
98
- */
99
-struct sip_msg*  sip_msg_cloner( struct sip_msg *org_msg, int *sip_msg_len );
100
-
101
-/**
102
- * @brief Indicates wheter we have already cloned the msg lumps or not
103
- */
104
-extern unsigned char lumps_are_cloned;
105
-
106
-/**
107
- * @brief Wrapper function for msg_lump_cloner() with some additional sanity checks
108
- * @param shm_msg SIP message in shared memory
109
- * @param pkg_msg SIP message in private memory
110
- * @return 0 on success, -1 on error
111
- */
112
-int save_msg_lumps( struct sip_msg *shm_msg, struct sip_msg *pkg_msg);
113
-
114
-
115
-#endif
Browse code

tm Remove svn ID, remove history, rename "ser" to "kamailio"

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

doxygen comment fixes (escapes, missing parameters, syntax errors) all over the place

Henning Westerholt authored on 22/07/2011 07:23:18
Showing 1 changed files
... ...
@@ -111,7 +111,7 @@ extern unsigned char lumps_are_cloned;
111 111
 /**
112 112
  * @brief Wrapper function for msg_lump_cloner() with some additional sanity checks
113 113
  * @param shm_msg SIP message in shared memory
114
- * @param pgk_msg SIP message in private memory
114
+ * @param pkg_msg SIP message in private memory
115 115
  * @return 0 on success, -1 on error
116 116
  */
117 117
 int save_msg_lumps( struct sip_msg *shm_msg, struct sip_msg *pkg_msg);
Browse code

tm: add doxygen documentation for sip_msg.[c,h] files

Henning Westerholt authored on 03/07/2011 22:40:21
Showing 1 changed files
... ...
@@ -1,6 +1,4 @@
1 1
 /*
2
- * $Id$
3
- *
4 2
  * Copyright (C) 2001-2003 FhG Fokus
5 3
  *
6 4
  * This file is part of ser, a free SIP server.
... ...
@@ -25,7 +23,27 @@
25 23
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
26 24
  */
27 25
 
28
-
26
+/**
27
+ * @file
28
+ * @brief TM :: Message cloning functionality
29
+ * 
30
+ * Cloning a message into shared memory (TM keeps a snapshot
31
+ * of messages in memory); note that many operations, which
32
+ * allocate pkg memory (such as parsing) cannot be used with
33
+ * a cloned message -- it would result in linking pkg structures
34
+ * to shmem msg and eventually in a memory error.
35
+ * 
36
+ * The cloned message is stored in a single memory fragment to
37
+ * save too many shm_mallocs -- these are expensive as they
38
+ * not only take lookup in fragment table but also a shmem lock
39
+ * operation (the same for shm_free)
40
+ * 
41
+ * Allow postponing the cloning of SIP msg:
42
+ * t_newtran() copies the requests to shm mem without the lumps,
43
+ * and t_forward_nonack() clones the lumps later when it is called
44
+ * the first time.
45
+ * @ingroup tm
46
+ */
29 47
 
30 48
 #ifndef _SIP_MSG_H
31 49
 #define _SIP_MSG_H
... ...
@@ -36,20 +54,18 @@
36 54
 #include "../../parser/msg_parser.h"
37 55
 #include "../../mem/shm_mem.h"
38 56
 
39
-/* Allow postponing the cloning of SIP msg:
40
- * t_newtran() copies the requests to shm mem without the lumps,
41
- * and t_forward_nonack() clones the lumps later when it is called
42
- * the first time.
43
- * Replies use only one memory block.
44
- */
45 57
 
46 58
 #include "../../atomic_ops.h" /* membar_depends() */
47 59
 
48
-/* msg is a reply: one memory block was allocated
60
+/**
61
+ * @brief Helper function to free a SIP message
62
+ * 
63
+ * msg is a reply: one memory block was allocated
64
+ * 
49 65
  * msg is a request: two memory blocks were allocated:
50
- *	- one for the sip_msg struct
51
- *	- another one for the lumps which is linked to
52
- *		add_rm, body_lumps, or reply_lump. 
66
+ * - one for the sip_msg struct
67
+ * - another one for the lumps which is linked to add_rm, body_lumps,
68
+ *   or reply_lump
53 69
  */
54 70
 #define  _sip_msg_free(_free_func, _p_msg) \
55 71
 		do{ \
... ...
@@ -69,14 +85,35 @@
69 85
 		}while(0)
70 86
 
71 87
 
88
+/**
89
+ * @brief Free a SIP message safely, with locking
90
+ */
72 91
 #define  sip_msg_free(_p_msg) _sip_msg_free(shm_free, _p_msg)
92
+/**
93
+ * @brief Free a SIP message unsafely, without locking
94
+ */
73 95
 #define  sip_msg_free_unsafe(_p_msg) _sip_msg_free(shm_free_unsafe, _p_msg)
74 96
 
75
-
97
+/**
98
+ * @brief Clone a SIP message
99
+ * @warning Cloner does not clone all hdr_field headers (From, To, etc.). Pointers will reference pkg memory. Dereferencing will crash ser!
100
+ * @param org_msg Original SIP message
101
+ * @param sip_msg_len Length of the SIP message
102
+ * @return Cloned SIP message, or NULL on error
103
+ */
76 104
 struct sip_msg*  sip_msg_cloner( struct sip_msg *org_msg, int *sip_msg_len );
77 105
 
106
+/**
107
+ * @brief Indicates wheter we have already cloned the msg lumps or not
108
+ */
78 109
 extern unsigned char lumps_are_cloned;
79 110
 
111
+/**
112
+ * @brief Wrapper function for msg_lump_cloner() with some additional sanity checks
113
+ * @param shm_msg SIP message in shared memory
114
+ * @param pgk_msg SIP message in private memory
115
+ * @return 0 on success, -1 on error
116
+ */
80 117
 int save_msg_lumps( struct sip_msg *shm_msg, struct sip_msg *pkg_msg);
81 118
 
82 119
 
Browse code

tm: remove #ifdef POSTPONE_MSG_CLONING, its default for three years now

- remove POSTPONE_MSG_CLONING define from tm module
- its now the default for more than three years
- control flow in the module without it is better understandable
- the current way is the expected behavior, also recently discussed on the list

Henning Westerholt authored on 03/07/2011 22:07:45
Showing 1 changed files
... ...
@@ -42,19 +42,15 @@
42 42
  * the first time.
43 43
  * Replies use only one memory block.
44 44
  */
45
-#define POSTPONE_MSG_CLONING
46 45
 
47
-#ifdef POSTPONE_MSG_CLONING
48 46
 #include "../../atomic_ops.h" /* membar_depends() */
49
-#endif
50 47
 
51
-#ifdef POSTPONE_MSG_CLONING
52
-	/* msg is a reply: one memory block was allocated
53
-	 * msg is a request: two memory blocks were allocated:
54
-	 *	- one for the sip_msg struct
55
-	 *	- another one for the lumps which is linked to
56
-	 *		add_rm, body_lumps, or reply_lump. 
57
-	 */
48
+/* msg is a reply: one memory block was allocated
49
+ * msg is a request: two memory blocks were allocated:
50
+ *	- one for the sip_msg struct
51
+ *	- another one for the lumps which is linked to
52
+ *		add_rm, body_lumps, or reply_lump. 
53
+ */
58 54
 #define  _sip_msg_free(_free_func, _p_msg) \
59 55
 		do{ \
60 56
 			if (_p_msg->first_line.type==SIP_REPLY) { \
... ...
@@ -72,13 +68,6 @@
72 68
 			} \
73 69
 		}while(0)
74 70
 
75
-#else /* POSTPONE_MSG_CLONING */
76
-
77
-	/* only one memory block was allocated */
78
-#define  _sip_msg_free(_free_func, _p_msg) \
79
-		_free_func( (_p_msg) )
80
-
81
-#endif /* POSTPONE_MSG_CLONING */
82 71
 
83 72
 #define  sip_msg_free(_p_msg) _sip_msg_free(shm_free, _p_msg)
84 73
 #define  sip_msg_free_unsafe(_p_msg) _sip_msg_free(shm_free_unsafe, _p_msg)
... ...
@@ -86,11 +75,9 @@
86 75
 
87 76
 struct sip_msg*  sip_msg_cloner( struct sip_msg *org_msg, int *sip_msg_len );
88 77
 
89
-#ifdef POSTPONE_MSG_CLONING
90 78
 extern unsigned char lumps_are_cloned;
91 79
 
92 80
 int save_msg_lumps( struct sip_msg *shm_msg, struct sip_msg *pkg_msg);
93
-#endif
94 81
 
95 82
 
96 83
 #endif
Browse code

Message lumps are saved to shared memory when t_relay() is called the first time, instead of saving them by t_newtran(). The advantage is that the SIP msg modifications that are made after t_newtran() are saved as well, and they are propagated to failure route. t_save_lumps() function is introduced, it can be used to force saving the lumps before t_relay(), check the doc for details. Fixes SER-303

The change can be reverted by uncommenting #define POSTPONE_MSG_CLONING
in sip_msg.h.

Miklos Tirpak authored on 26/03/2008 11:06:03
Showing 1 changed files
... ...
@@ -36,11 +36,61 @@
36 36
 #include "../../parser/msg_parser.h"
37 37
 #include "../../mem/shm_mem.h"
38 38
 
39
-#define  sip_msg_free(_p_msg) shm_free( (_p_msg ))
40
-#define  sip_msg_free_unsafe(_p_msg) shm_free_unsafe( (_p_msg) )
39
+/* Allow postponing the cloning of SIP msg:
40
+ * t_newtran() copies the requests to shm mem without the lumps,
41
+ * and t_forward_nonack() clones the lumps later when it is called
42
+ * the first time.
43
+ * Replies use only one memory block.
44
+ */
45
+#define POSTPONE_MSG_CLONING
46
+
47
+#ifdef POSTPONE_MSG_CLONING
48
+#include "../../atomic_ops.h" /* membar_depends() */
49
+#endif
50
+
51
+#ifdef POSTPONE_MSG_CLONING
52
+	/* msg is a reply: one memory block was allocated
53
+	 * msg is a request: two memory blocks were allocated:
54
+	 *	- one for the sip_msg struct
55
+	 *	- another one for the lumps which is linked to
56
+	 *		add_rm, body_lumps, or reply_lump. 
57
+	 */
58
+#define  _sip_msg_free(_free_func, _p_msg) \
59
+		do{ \
60
+			if (_p_msg->first_line.type==SIP_REPLY) { \
61
+				_free_func( (_p_msg) ); \
62
+			} else { \
63
+				membar_depends(); \
64
+				if ((_p_msg)->add_rm) \
65
+					_free_func((_p_msg)->add_rm); \
66
+				else if ((_p_msg)->body_lumps) \
67
+					_free_func((_p_msg)->body_lumps); \
68
+				else if ((_p_msg)->reply_lump) \
69
+					_free_func((_p_msg)->reply_lump); \
70
+									  \
71
+				_free_func( (_p_msg) ); \
72
+			} \
73
+		}while(0)
74
+
75
+#else /* POSTPONE_MSG_CLONING */
76
+
77
+	/* only one memory block was allocated */
78
+#define  _sip_msg_free(_free_func, _p_msg) \
79
+		_free_func( (_p_msg) )
80
+
81
+#endif /* POSTPONE_MSG_CLONING */
82
+
83
+#define  sip_msg_free(_p_msg) _sip_msg_free(shm_free, _p_msg)
84
+#define  sip_msg_free_unsafe(_p_msg) _sip_msg_free(shm_free_unsafe, _p_msg)
41 85
 
42 86
 
43 87
 struct sip_msg*  sip_msg_cloner( struct sip_msg *org_msg, int *sip_msg_len );
44 88
 
89
+#ifdef POSTPONE_MSG_CLONING
90
+extern unsigned char lumps_are_cloned;
91
+
92
+int save_msg_lumps( struct sip_msg *shm_msg, struct sip_msg *pkg_msg);
93
+#endif
94
+
45 95
 
46 96
 #endif
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
  *
Browse code

some enhancement related to failure handlers processing: - lumps (add_rm and body_lumps) are not any more duplicated, used and removed -> are used direclty the ones from shm memory and at the end all non shm lumps are removed. - after failure handlers are executed, all non null hdr->parsed are checked if points into cloned request's memory chunk. If not, it means the parse was added by failure handlers (some function did some parsing there) and it will be freed as pkg mem. -> It will be safe to call from failure route any functions that does parsing without any additional modifications.

Bogdan-Andrei Iancu authored on 23/02/2004 16:47:43
Showing 1 changed files
... ...
@@ -40,7 +40,7 @@
40 40
 #define  sip_msg_free_unsafe(_p_msg) shm_free_unsafe( (_p_msg) )
41 41
 
42 42
 
43
-struct sip_msg*  sip_msg_cloner( struct sip_msg *org_msg );
43
+struct sip_msg*  sip_msg_cloner( struct sip_msg *org_msg, int *sip_msg_len );
44 44
 
45 45
 
46 46
 #endif
Browse code

preliminary support for FIFO/t_uac added -- compiles, but not completed yet

Jiri Kuthan authored on 21/01/2003 13:53:48
Showing 1 changed files
... ...
@@ -30,6 +30,9 @@
30 30
 #ifndef _SIP_MSG_H
31 31
 #define _SIP_MSG_H
32 32
 
33
+#include "defs.h"
34
+
35
+
33 36
 #include "../../parser/msg_parser.h"
34 37
 #include "../../mem/shm_mem.h"
35 38
 
Browse code

GPLization banner introduced to *.[hc] files

Jiri Kuthan authored on 19/09/2002 12:23:52
Showing 1 changed files
... ...
@@ -1,8 +1,32 @@
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
 
5 28
 
29
+
6 30
 #ifndef _SIP_MSG_H
7 31
 #define _SIP_MSG_H
8 32
 
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
... ...
@@ -7,8 +7,7 @@
7 7
 #define _SIP_MSG_H
8 8
 
9 9
 #include "../../parser/msg_parser.h"
10
-
11
-#include "sh_malloc.h"
10
+#include "../../mem/shm_mem.h"
12 11
 
13 12
 #define  sip_msg_free(_p_msg) shm_free( (_p_msg ))
14 13
 #define  sip_msg_free_unsafe(_p_msg) shm_free_unsafe( (_p_msg) )
Browse code

TM callbacks, acc, flags

Jiri Kuthan authored on 13/05/2002 01:15:40
Showing 1 changed files
... ...
@@ -6,7 +6,7 @@
6 6
 #ifndef _SIP_MSG_H
7 7
 #define _SIP_MSG_H
8 8
 
9
-#include "../../msg_parser.h"
9
+#include "../../parser/msg_parser.h"
10 10
 
11 11
 #include "sh_malloc.h"
12 12
 
Browse code

To parsing and tag used in ACK matching

Bogdan-Andrei Iancu authored on 07/02/2002 16:02:45
Showing 1 changed files
... ...
@@ -10,20 +10,11 @@
10 10
 
11 11
 #include "sh_malloc.h"
12 12
 
13
-#define sip_msg_cloner(p_msg) \
14
-    sip_msg_cloner_2(p_msg)
15
-
16 13
 #define  sip_msg_free(_p_msg) shm_free( (_p_msg ))
17 14
 #define  sip_msg_free_unsafe(_p_msg) shm_free_unsafe( (_p_msg) )
18 15
 
19 16
 
20
-struct sip_msg*  sip_msg_cloner_1( struct sip_msg *org_msg );
21
-struct sip_msg*  sip_msg_cloner_2( struct sip_msg *org_msg );
22
-void                     sip_msg_free_1( struct sip_msg *org_msg );
23
-
24
-
25
-
26
-//char*   translate_pointer( char* new_buf , char *org_buf , char* p);
17
+struct sip_msg*  sip_msg_cloner( struct sip_msg *org_msg );
27 18
 
28 19
 
29 20
 #endif
Browse code

max forward

Bogdan-Andrei Iancu authored on 29/01/2002 17:28:40
Showing 1 changed files
... ...
@@ -16,9 +16,6 @@
16 16
 #define  sip_msg_free(_p_msg) shm_free( (_p_msg ))
17 17
 #define  sip_msg_free_unsafe(_p_msg) shm_free_unsafe( (_p_msg) )
18 18
 
19
-#define  translate_pointer( _new_buf , _org_buf , _p) \
20
-              ( (_p)?(_new_buf + (_p-_org_buf)):(0) )
21
-
22 19
 
23 20
 struct sip_msg*  sip_msg_cloner_1( struct sip_msg *org_msg );
24 21
 struct sip_msg*  sip_msg_cloner_2( struct sip_msg *org_msg );
Browse code

*** empty log message ***

Bogdan-Andrei Iancu authored on 28/01/2002 20:31:50
Showing 1 changed files
... ...
@@ -13,15 +13,20 @@
13 13
 #define sip_msg_cloner(p_msg) \
14 14
     sip_msg_cloner_2(p_msg)
15 15
 
16
-#define sip_msg_free(_p_msg) shm_free( (_p_msg ))
17
-#define sip_msg_free_unsafe(_p_msg) shm_free_unsafe( (_p_msg) )
18
-/*    sip_msg_free_2(p_msg) */
16
+#define  sip_msg_free(_p_msg) shm_free( (_p_msg ))
17
+#define  sip_msg_free_unsafe(_p_msg) shm_free_unsafe( (_p_msg) )
18
+
19
+#define  translate_pointer( _new_buf , _org_buf , _p) \
20
+              ( (_p)?(_new_buf + (_p-_org_buf)):(0) )
19 21
 
20 22
 
21 23
 struct sip_msg*  sip_msg_cloner_1( struct sip_msg *org_msg );
22 24
 struct sip_msg*  sip_msg_cloner_2( struct sip_msg *org_msg );
23 25
 void                     sip_msg_free_1( struct sip_msg *org_msg );
24
-/* void                     sip_msg_free_2( struct sip_msg *org_msg ); */
26
+
27
+
28
+
29
+//char*   translate_pointer( char* new_buf , char *org_buf , char* p);
25 30
 
26 31
 
27 32
 #endif
Browse code

reduction of lock/malloc calls

Jiri Kuthan authored on 11/01/2002 03:32:18
Showing 1 changed files
... ...
@@ -13,14 +13,15 @@
13 13
 #define sip_msg_cloner(p_msg) \
14 14
     sip_msg_cloner_2(p_msg)
15 15
 
16
-#define sip_msg_free(p_msg) \
17
-    sip_msg_free_2(p_msg)
16
+#define sip_msg_free(_p_msg) shm_free( (_p_msg ))
17
+#define sip_msg_free_unsafe(_p_msg) shm_free_unsafe( (_p_msg) )
18
+/*    sip_msg_free_2(p_msg) */
18 19
 
19 20
 
20 21
 struct sip_msg*  sip_msg_cloner_1( struct sip_msg *org_msg );
21 22
 struct sip_msg*  sip_msg_cloner_2( struct sip_msg *org_msg );
22 23
 void                     sip_msg_free_1( struct sip_msg *org_msg );
23
-void                     sip_msg_free_2( struct sip_msg *org_msg );
24
+/* void                     sip_msg_free_2( struct sip_msg *org_msg ); */
24 25
 
25 26
 
26 27
 #endif
Browse code

new clonning function added

Bogdan-Andrei Iancu authored on 18/12/2001 00:30:46
Showing 1 changed files
... ...
@@ -11,10 +11,10 @@
11 11
 #include "sh_malloc.h"
12 12
 
13 13
 #define sip_msg_cloner(p_msg) \
14
-    sip_msg_cloner_1(p_msg)
14
+    sip_msg_cloner_2(p_msg)
15 15
 
16 16
 #define sip_msg_free(p_msg) \
17
-    sip_msg_free_1(p_msg)
17
+    sip_msg_free_2(p_msg)
18 18
 
19 19
 
20 20
 struct sip_msg*  sip_msg_cloner_1( struct sip_msg *org_msg );
... ...
@@ -22,8 +22,5 @@ struct sip_msg*  sip_msg_cloner_2( struct sip_msg *org_msg );
22 22
 void                     sip_msg_free_1( struct sip_msg *org_msg );
23 23
 void                     sip_msg_free_2( struct sip_msg *org_msg );
24 24
 
25
-char*   translate_pointer( char* new_buf , char *org_buf , char* p);
26
-struct via_body* via_body_cloner( char* new_buf , char *org_buf , struct via_body *org_via);
27
-struct hdr_field* header_cloner( struct sip_msg *new_msg , struct sip_msg *org_msg, struct hdr_field *hdr);
28 25
 
29 26
 #endif
Browse code

*** empty log message ***

Bogdan-Andrei Iancu authored on 13/12/2001 21:54:43
Showing 1 changed files
... ...
@@ -10,9 +10,17 @@
10 10
 
11 11
 #include "sh_malloc.h"
12 12
 
13
+#define sip_msg_cloner(p_msg) \
14
+    sip_msg_cloner_1(p_msg)
13 15
 
14
-struct sip_msg*  sip_msg_cloner( struct sip_msg *org_msg );
15
-void                     sip_msg_free( struct sip_msg *org_msg );
16
+#define sip_msg_free(p_msg) \
17
+    sip_msg_free_1(p_msg)
18
+
19
+
20
+struct sip_msg*  sip_msg_cloner_1( struct sip_msg *org_msg );
21
+struct sip_msg*  sip_msg_cloner_2( struct sip_msg *org_msg );
22
+void                     sip_msg_free_1( struct sip_msg *org_msg );
23
+void                     sip_msg_free_2( struct sip_msg *org_msg );
16 24
 
17 25
 char*   translate_pointer( char* new_buf , char *org_buf , char* p);
18 26
 struct via_body* via_body_cloner( char* new_buf , char *org_buf , struct via_body *org_via);
Browse code

added CVS ID

Jiri Kuthan authored on 05/12/2001 22:14:30
Showing 1 changed files
... ...
@@ -1,3 +1,8 @@
1
+/*
2
+ * $Id$
3
+ */
4
+
5
+
1 6
 #ifndef _SIP_MSG_H
2 7
 #define _SIP_MSG_H
3 8
 
Browse code

added sh_malloc.h

Jiri Kuthan authored on 03/12/2001 23:03:50
Showing 1 changed files
... ...
@@ -3,8 +3,7 @@
3 3
 
4 4
 #include "../../msg_parser.h"
5 5
 
6
-#define sh_malloc( size )  malloc(size)
7
-#define sh_free( ptr )        free(ptr)
6
+#include "sh_malloc.h"
8 7
 
9 8
 
10 9
 struct sip_msg*  sip_msg_cloner( struct sip_msg *org_msg );
Browse code

just next one

Jiri Kuthan authored on 29/11/2001 00:00:58
Showing 1 changed files
... ...
@@ -10,4 +10,8 @@
10 10
 struct sip_msg*  sip_msg_cloner( struct sip_msg *org_msg );
11 11
 void                     sip_msg_free( struct sip_msg *org_msg );
12 12
 
13
+char*   translate_pointer( char* new_buf , char *org_buf , char* p);
14
+struct via_body* via_body_cloner( char* new_buf , char *org_buf , struct via_body *org_via);
15
+struct hdr_field* header_cloner( struct sip_msg *new_msg , struct sip_msg *org_msg, struct hdr_field *hdr);
16
+
13 17
 #endif
Browse code

*** empty log message ***

Bogdan-Andrei Iancu authored on 26/11/2001 21:21:09
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,13 @@
1
+#ifndef _SIP_MSG_H
2
+#define _SIP_MSG_H
3
+
4
+#include "../../msg_parser.h"
5
+
6
+#define sh_malloc( size )  malloc(size)
7
+#define sh_free( ptr )        free(ptr)
8
+
9
+
10
+struct sip_msg*  sip_msg_cloner( struct sip_msg *org_msg );
11
+void                     sip_msg_free( struct sip_msg *org_msg );
12
+
13
+#endif