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,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
Browse code

core: Modify doxygen, remove history, remove SVN IDs, change "ser" and "sip-router" to "KAMAILIO"

Olle E. Johansson authored on 16/01/2015 16:38:46
Showing 1 changed files
... ...
@@ -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)
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
... ...
@@ -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:
Browse code

Kamailio compatibility: Rename MDStringArray to MD5StringArray

Jan Janak authored on 10/03/2009 22:46:05
Showing 1 changed files
... ...
@@ -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;
Browse code

- Spelling checked - READMEs updated

Jan Janak authored on 24/08/2004 08:45:09
Showing 1 changed files
... ...
@@ -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;
Browse code

- exec_pre_cb called after basic sanity checks (at least 1 via present)

Andrei Pelinescu-Onciul authored on 30/04/2004 11:57:27
Showing 1 changed files
... ...
@@ -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)
Browse code

- sock_lists completely re-organized

Andrei Pelinescu-Onciul authored on 24/10/2003 20:23:58
Showing 1 changed files
... ...
@@ -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
 
Browse code

- added missing header field

Jan Janak authored on 29/04/2003 16:32:11
Showing 1 changed files
... ...
@@ -45,6 +45,7 @@
45 45
 #define _TAGS_H
46 46
 
47 47
 #include "parser/msg_parser.h"
48
+#include "globals.h"
48 49
 #include "crc.h"
49 50
 #include "str.h"
50 51
 
Browse code

- tm tcp support (though no timers yet) changelist (random order): - forward.c: removed calls to upd_send & tcp_send & replaced them with calls to msg_send - ip_addr.h: added struct dest_info (used in tm rbs) - proxy.c: all *proxy fucntions require also the protocol - resolve.c: added proto to sip_resolvehost, for SRV lookups - tags.h: changed TOTAG_LEN into TOTAG_VALUE_LEN, to solve redefinition conflict with tm/t_msgbuilder.h - modules/sl/sl_funcs.c: modified sl_send_reply to use the transport independend msg_send - modules/tm/t_funcs.c: modified send_pr_buffer to use msg_send & rb->dst - modules/tm/t_fwd.c: added proto to various functions - modules/tm/t_lookup.c: init_rb() is proto indep. & it uses struct dest_info - modules/tm/t_msgbuilder.c: build_uac_request uses proto - modules/tm/t_reply.c: updated to use rb->dst, fixed TOTAG_LEN bug - modules/tm/tm.c: added t_forward_nonack_{udp, tcp}, t_relay_to_{udp,tcp}, t_replicate_{udp, tcp} - modules/tm/uac.c: t_uac, t _uac_dlg, gethfblock, uri2proxy changed to use proto & rb->dst - modules/tm/ut.h: added proto to uri2proxy

old tag & version: pre6-tcp4
new tag & version (current): pre6-tcp5-tm

Andrei Pelinescu-Onciul authored on 19/02/2003 17:16:41
Showing 1 changed files
... ...
@@ -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
Browse code

to_tags now generated all the time from TM

Jiri Kuthan authored on 21/10/2002 21:24:43
Showing 1 changed files
... ...
@@ -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];
Browse code

tags generation moved to core

Jiri Kuthan authored on 21/10/2002 20:30:15
Showing 1 changed files
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