- 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)
1 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,79 +0,0 @@ |
1 |
-/* |
|
2 |
- * - utility for generating to-tags |
|
3 |
- * in Kamailio, to-tags consist of two parts: a fixed part |
|
4 |
- * which is bound to server instance and variable part |
|
5 |
- * which is bound to request -- that helps to recognize, |
|
6 |
- * who generated the to-tag in loops through the same |
|
7 |
- * server -- in such cases, fixed part is constant, but |
|
8 |
- * the variable part varies because it depends on |
|
9 |
- * via |
|
10 |
- * |
|
11 |
- * Copyright (C) 2001-2003 FhG Fokus |
|
12 |
- * |
|
13 |
- * This file is part of Kamailio, a free SIP server. |
|
14 |
- * |
|
15 |
- * Kamailio is free software; you can redistribute it and/or modify |
|
16 |
- * it under the terms of the GNU General Public License as published by |
|
17 |
- * the Free Software Foundation; either version 2 of the License, or |
|
18 |
- * (at your option) any later version |
|
19 |
- * |
|
20 |
- * Kamailio 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
|
28 |
- */ |
|
29 |
- |
|
30 |
-#ifndef _TAGS_H |
|
31 |
-#define _TAGS_H |
|
32 |
- |
|
33 |
-#include "parser/msg_parser.h" |
|
34 |
-#include "globals.h" |
|
35 |
-#include "crc.h" |
|
36 |
-#include "str.h" |
|
37 |
-#include "socket_info.h" |
|
38 |
- |
|
39 |
-#define TOTAG_VALUE_LEN (MD5_LEN+CRC16_LEN+1) |
|
40 |
- |
|
41 |
-/*! generate variable part of to-tag for a request; |
|
42 |
- * it will have length of CRC16_LEN, sufficiently |
|
43 |
- * long buffer must be passed to the function */ |
|
44 |
-static inline void calc_crc_suffix( struct sip_msg *msg, char *tag_suffix) |
|
45 |
-{ |
|
46 |
- int ss_nr; |
|
47 |
- str suffix_source[3]; |
|
48 |
- |
|
49 |
- ss_nr=2; |
|
50 |
- if (msg->via1==0) return; /* no via, bad message */ |
|
51 |
- suffix_source[0]=msg->via1->host; |
|
52 |
- suffix_source[1]=msg->via1->port_str; |
|
53 |
- if (msg->via1->branch) |
|
54 |
- suffix_source[ss_nr++]=msg->via1->branch->value; |
|
55 |
- crcitt_string_array( tag_suffix, suffix_source, ss_nr ); |
|
56 |
-} |
|
57 |
- |
|
58 |
-static void inline init_tags( char *tag, char **suffix, |
|
59 |
- char *signature, char separator ) |
|
60 |
-{ |
|
61 |
- str src[3]; |
|
62 |
- struct socket_info* si; |
|
63 |
- |
|
64 |
- si=get_first_socket(); |
|
65 |
- src[0].s=signature; src[0].len=strlen(signature); |
|
66 |
- /* if we are not listening on anything we shouldn't be here */ |
|
67 |
- src[1].s=si?si->address_str.s:""; |
|
68 |
- src[1].len=si?si->address_str.len:0; |
|
69 |
- src[2].s=si?si->port_no_str.s:""; |
|
70 |
- src[2].len=si?si->port_no_str.len:0; |
|
71 |
- |
|
72 |
- MD5StringArray( tag, src, 3 ); |
|
73 |
- |
|
74 |
- tag[MD5_LEN]=separator; |
|
75 |
- *suffix=tag+MD5_LEN+1; |
|
76 |
-} |
|
77 |
- |
|
78 |
- |
|
79 |
-#endif |
... | ... |
@@ -1,8 +1,6 @@ |
1 | 1 |
/* |
2 |
- * $Id$ |
|
3 |
- * |
|
4 | 2 |
* - utility for generating to-tags |
5 |
- * in SER, to-tags consist of two parts: a fixed part |
|
3 |
+ * in Kamailio, to-tags consist of two parts: a fixed part |
|
6 | 4 |
* which is bound to server instance and variable part |
7 | 5 |
* which is bound to request -- that helps to recognize, |
8 | 6 |
* who generated the to-tag in loops through the same |
... | ... |
@@ -12,19 +10,14 @@ |
12 | 10 |
* |
13 | 11 |
* Copyright (C) 2001-2003 FhG Fokus |
14 | 12 |
* |
15 |
- * This file is part of ser, a free SIP server. |
|
13 |
+ * This file is part of Kamailio, a free SIP server. |
|
16 | 14 |
* |
17 |
- * ser is free software; you can redistribute it and/or modify |
|
15 |
+ * Kamailio is free software; you can redistribute it and/or modify |
|
18 | 16 |
* it under the terms of the GNU General Public License as published by |
19 | 17 |
* the Free Software Foundation; either version 2 of the License, or |
20 | 18 |
* (at your option) any later version |
21 | 19 |
* |
22 |
- * For a license to use the ser software under conditions |
|
23 |
- * other than those described here, or to purchase support for this |
|
24 |
- * software, please contact iptel.org by e-mail at the following addresses: |
|
25 |
- * info@iptel.org |
|
26 |
- * |
|
27 |
- * ser is distributed in the hope that it will be useful, |
|
20 |
+ * Kamailio is distributed in the hope that it will be useful, |
|
28 | 21 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
29 | 22 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
30 | 23 |
* GNU General Public License for more details. |
... | ... |
@@ -33,13 +26,6 @@ |
33 | 26 |
* along with this program; if not, write to the Free Software |
34 | 27 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
35 | 28 |
*/ |
36 |
-/* |
|
37 |
- * History: |
|
38 |
- * -------- |
|
39 |
- * 2003-02-18 changed TOTAG_LEN into TOTAG_VALUE_LEN, to solve |
|
40 |
- * redefinition conflict with tm/t_msgbuilder.h (andrei) |
|
41 |
- */ |
|
42 |
- |
|
43 | 29 |
|
44 | 30 |
#ifndef _TAGS_H |
45 | 31 |
#define _TAGS_H |
... | ... |
@@ -52,7 +38,7 @@ |
52 | 38 |
|
53 | 39 |
#define TOTAG_VALUE_LEN (MD5_LEN+CRC16_LEN+1) |
54 | 40 |
|
55 |
-/* generate variable part of to-tag for a request; |
|
41 |
+/*! generate variable part of to-tag for a request; |
|
56 | 42 |
* it will have length of CRC16_LEN, sufficiently |
57 | 43 |
* long buffer must be passed to the function */ |
58 | 44 |
static inline void calc_crc_suffix( struct sip_msg *msg, char *tag_suffix) |
... | ... |
@@ -31,7 +31,7 @@ |
31 | 31 |
* |
32 | 32 |
* You should have received a copy of the GNU General Public License |
33 | 33 |
* along with this program; if not, write to the Free Software |
34 |
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
34 |
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
|
35 | 35 |
*/ |
36 | 36 |
/* |
37 | 37 |
* History: |
... | ... |
@@ -83,7 +83,7 @@ static void inline init_tags( char *tag, char **suffix, |
83 | 83 |
src[2].s=si?si->port_no_str.s:""; |
84 | 84 |
src[2].len=si?si->port_no_str.len:0; |
85 | 85 |
|
86 |
- MDStringArray( tag, src, 3 ); |
|
86 |
+ MD5StringArray( tag, src, 3 ); |
|
87 | 87 |
|
88 | 88 |
tag[MD5_LEN]=separator; |
89 | 89 |
*suffix=tag+MD5_LEN+1; |
... | ... |
@@ -10,7 +10,7 @@ |
10 | 10 |
* the variable part varies because it depends on |
11 | 11 |
* via |
12 | 12 |
* |
13 |
- * Copyright (C) 2001-2003 Fhg Fokus |
|
13 |
+ * Copyright (C) 2001-2003 FhG Fokus |
|
14 | 14 |
* |
15 | 15 |
* This file is part of ser, a free SIP server. |
16 | 16 |
* |
... | ... |
@@ -54,7 +54,7 @@ |
54 | 54 |
|
55 | 55 |
/* generate variable part of to-tag for a request; |
56 | 56 |
* it will have length of CRC16_LEN, sufficiently |
57 |
- * long buffer must be passed to the fucntion */ |
|
57 |
+ * long buffer must be passed to the function */ |
|
58 | 58 |
static inline void calc_crc_suffix( struct sip_msg *msg, char *tag_suffix) |
59 | 59 |
{ |
60 | 60 |
int ss_nr; |
... | ... |
@@ -61,6 +61,7 @@ static inline void calc_crc_suffix( struct sip_msg *msg, char *tag_suffix) |
61 | 61 |
str suffix_source[3]; |
62 | 62 |
|
63 | 63 |
ss_nr=2; |
64 |
+ if (msg->via1==0) return; /* no via, bad message */ |
|
64 | 65 |
suffix_source[0]=msg->via1->host; |
65 | 66 |
suffix_source[1]=msg->via1->port_str; |
66 | 67 |
if (msg->via1->branch) |
... | ... |
@@ -48,6 +48,7 @@ |
48 | 48 |
#include "globals.h" |
49 | 49 |
#include "crc.h" |
50 | 50 |
#include "str.h" |
51 |
+#include "socket_info.h" |
|
51 | 52 |
|
52 | 53 |
#define TOTAG_VALUE_LEN (MD5_LEN+CRC16_LEN+1) |
53 | 54 |
|
... | ... |
@@ -71,12 +72,15 @@ static void inline init_tags( char *tag, char **suffix, |
71 | 72 |
char *signature, char separator ) |
72 | 73 |
{ |
73 | 74 |
str src[3]; |
74 |
- |
|
75 |
+ struct socket_info* si; |
|
76 |
+ |
|
77 |
+ si=get_first_socket(); |
|
75 | 78 |
src[0].s=signature; src[0].len=strlen(signature); |
76 |
- src[1].s=sock_info[0].address_str.s; |
|
77 |
- src[1].len=sock_info[0].address_str.len; |
|
78 |
- src[2].s=sock_info[0].port_no_str.s; |
|
79 |
- src[2].len=sock_info[0].port_no_str.len; |
|
79 |
+ /* if we are not listening on anything we shouldn't be here */ |
|
80 |
+ src[1].s=si?si->address_str.s:""; |
|
81 |
+ src[1].len=si?si->address_str.len:0; |
|
82 |
+ src[2].s=si?si->port_no_str.s:""; |
|
83 |
+ src[2].len=si?si->port_no_str.len:0; |
|
80 | 84 |
|
81 | 85 |
MDStringArray( tag, src, 3 ); |
82 | 86 |
|
old tag & version: pre6-tcp4
new tag & version (current): pre6-tcp5-tm
... | ... |
@@ -33,6 +33,12 @@ |
33 | 33 |
* along with this program; if not, write to the Free Software |
34 | 34 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
35 | 35 |
*/ |
36 |
+/* |
|
37 |
+ * History: |
|
38 |
+ * -------- |
|
39 |
+ * 2003-02-18 changed TOTAG_LEN into TOTAG_VALUE_LEN, to solve |
|
40 |
+ * redefinition conflict with tm/t_msgbuilder.h (andrei) |
|
41 |
+ */ |
|
36 | 42 |
|
37 | 43 |
|
38 | 44 |
#ifndef _TAGS_H |
... | ... |
@@ -42,7 +48,7 @@ |
42 | 48 |
#include "crc.h" |
43 | 49 |
#include "str.h" |
44 | 50 |
|
45 |
-#define TOTAG_LEN (MD5_LEN+CRC16_LEN+1) |
|
51 |
+#define TOTAG_VALUE_LEN (MD5_LEN+CRC16_LEN+1) |
|
46 | 52 |
|
47 | 53 |
/* generate variable part of to-tag for a request; |
48 | 54 |
* it will have length of CRC16_LEN, sufficiently |
... | ... |
@@ -60,7 +60,7 @@ static inline void calc_crc_suffix( struct sip_msg *msg, char *tag_suffix) |
60 | 60 |
crcitt_string_array( tag_suffix, suffix_source, ss_nr ); |
61 | 61 |
} |
62 | 62 |
|
63 |
-static inline init_tags( char *tag, char **suffix, |
|
63 |
+static void inline init_tags( char *tag, char **suffix, |
|
64 | 64 |
char *signature, char separator ) |
65 | 65 |
{ |
66 | 66 |
str src[3]; |
1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,81 @@ |
1 |
+/* |
|
2 |
+ * $Id$ |
|
3 |
+ * |
|
4 |
+ * - utility for generating to-tags |
|
5 |
+ * in SER, to-tags consist of two parts: a fixed part |
|
6 |
+ * which is bound to server instance and variable part |
|
7 |
+ * which is bound to request -- that helps to recognize, |
|
8 |
+ * who generated the to-tag in loops through the same |
|
9 |
+ * server -- in such cases, fixed part is constant, but |
|
10 |
+ * the variable part varies because it depends on |
|
11 |
+ * via |
|
12 |
+ * |
|
13 |
+ * Copyright (C) 2001-2003 Fhg Fokus |
|
14 |
+ * |
|
15 |
+ * This file is part of ser, a free SIP server. |
|
16 |
+ * |
|
17 |
+ * ser is free software; you can redistribute it and/or modify |
|
18 |
+ * it under the terms of the GNU General Public License as published by |
|
19 |
+ * the Free Software Foundation; either version 2 of the License, or |
|
20 |
+ * (at your option) any later version |
|
21 |
+ * |
|
22 |
+ * For a license to use the ser software under conditions |
|
23 |
+ * other than those described here, or to purchase support for this |
|
24 |
+ * software, please contact iptel.org by e-mail at the following addresses: |
|
25 |
+ * info@iptel.org |
|
26 |
+ * |
|
27 |
+ * ser is distributed in the hope that it will be useful, |
|
28 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
29 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
30 |
+ * GNU General Public License for more details. |
|
31 |
+ * |
|
32 |
+ * You should have received a copy of the GNU General Public License |
|
33 |
+ * along with this program; if not, write to the Free Software |
|
34 |
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
35 |
+ */ |
|
36 |
+ |
|
37 |
+ |
|
38 |
+#ifndef _TAGS_H |
|
39 |
+#define _TAGS_H |
|
40 |
+ |
|
41 |
+#include "parser/msg_parser.h" |
|
42 |
+#include "crc.h" |
|
43 |
+#include "str.h" |
|
44 |
+ |
|
45 |
+#define TOTAG_LEN (MD5_LEN+CRC16_LEN+1) |
|
46 |
+ |
|
47 |
+/* generate variable part of to-tag for a request; |
|
48 |
+ * it will have length of CRC16_LEN, sufficiently |
|
49 |
+ * long buffer must be passed to the fucntion */ |
|
50 |
+static inline void calc_crc_suffix( struct sip_msg *msg, char *tag_suffix) |
|
51 |
+{ |
|
52 |
+ int ss_nr; |
|
53 |
+ str suffix_source[3]; |
|
54 |
+ |
|
55 |
+ ss_nr=2; |
|
56 |
+ suffix_source[0]=msg->via1->host; |
|
57 |
+ suffix_source[1]=msg->via1->port_str; |
|
58 |
+ if (msg->via1->branch) |
|
59 |
+ suffix_source[ss_nr++]=msg->via1->branch->value; |
|
60 |
+ crcitt_string_array( tag_suffix, suffix_source, ss_nr ); |
|
61 |
+} |
|
62 |
+ |
|
63 |
+static inline init_tags( char *tag, char **suffix, |
|
64 |
+ char *signature, char separator ) |
|
65 |
+{ |
|
66 |
+ str src[3]; |
|
67 |
+ |
|
68 |
+ src[0].s=signature; src[0].len=strlen(signature); |
|
69 |
+ src[1].s=sock_info[0].address_str.s; |
|
70 |
+ src[1].len=sock_info[0].address_str.len; |
|
71 |
+ src[2].s=sock_info[0].port_no_str.s; |
|
72 |
+ src[2].len=sock_info[0].port_no_str.len; |
|
73 |
+ |
|
74 |
+ MDStringArray( tag, src, 3 ); |
|
75 |
+ |
|
76 |
+ tag[MD5_LEN]=separator; |
|
77 |
+ *suffix=tag+MD5_LEN+1; |
|
78 |
+} |
|
79 |
+ |
|
80 |
+ |
|
81 |
+#endif |