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,90 +0,0 @@
1
-/* 
2
- * Copyright (C) 2007 iptelorg GmbH
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 Parser :: Retry-After: header parser
24
- *
25
- * \ingroup parser
26
- */
27
- 
28
-
29
-#include "../comp_defs.h"
30
-#include "parse_retry_after.h"
31
-#include "parser_f.h"  /* eat_space_end and so on */
32
-#include "parse_def.h"
33
-#include "../dprint.h"
34
-#include "../mem/mem.h"
35
-
36
-/*! \brief Parse the Retry-after header field */
37
-char* parse_retry_after(char* const buf, const char* const end, unsigned* const after, int* const err)
38
-{
39
-	char *t;
40
-	int i;
41
-	unsigned val;
42
-	
43
-	val=0;
44
-	t=buf;
45
-	
46
-	t=eat_lws_end(t, end);
47
-	if (t>=end) goto error;
48
-	for (i=0; t<end; i++,t++){
49
-		if ((*t >= '0') && (*t <= '9')){
50
-			val=val*10+(*t-'0');
51
-		}else{
52
-			switch(*t){
53
-				/* for now we don't care about retry-after params or comment*/
54
-				case ' ':
55
-				case '\t':
56
-				case ';':
57
-				case '\r':
58
-				case '\n':
59
-				case '(':
60
-					goto found;
61
-				default:
62
-					/* invalid char */
63
-					goto error;
64
-			}
65
-		}
66
-	}
67
-	goto error_nocrlf; /* end reached without encountering cr or lf */
68
-found:
69
-	if (i>10 || i==0) /* too many  or too few digits */
70
-		goto error;
71
-	*after=val;
72
-	/* find the end of header */
73
-	for (; t<end; t++){
74
-		if (*t=='\n'){
75
-			if (((t+1)<end) && (*(t+1)==' ' || *(t+1)=='\t')){
76
-				t++;
77
-				continue; /* line folding ... */
78
-			}
79
-			*err=0;
80
-			return t+1;
81
-		}
82
-	}
83
-error_nocrlf:
84
-	LOG(L_ERR, "ERROR: parse_retry_after: strange EoHF\n");
85
-	goto error;
86
-error:
87
-	LOG(L_ERR, "ERROR: parse_retry_after: bad Retry-After header \n");
88
-	*err=1;
89
-	return t;
90
-}
Browse code

parser: Fix parser error when Retry-After is last header

- Prevent off-by-one error when CRLF is followed by CRLF

Hugh Waite authored on 17/09/2015 14:50:48
Showing 1 changed files
... ...
@@ -72,8 +72,6 @@ found:
72 72
 	/* find the end of header */
73 73
 	for (; t<end; t++){
74 74
 		if (*t=='\n'){
75
-			if (((t+1)<end) && (*(t+1)=='\r'))
76
-				t++;
77 75
 			if (((t+1)<end) && (*(t+1)==' ' || *(t+1)=='\t')){
78 76
 				t++;
79 77
 				continue; /* line folding ... */
Browse code

core parser - remove svn ID, remove history, change "ser" => "Kamailio"

Olle E. Johansson authored on 18/01/2015 19:36:18
Showing 1 changed files
... ...
@@ -1,14 +1,14 @@
1 1
 /* 
2 2
  * Copyright (C) 2007 iptelorg GmbH
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
- * ser is distributed in the hope that it will be useful,
11
+ * Kamailio is distributed in the hope that it will be useful,
12 12
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 13
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 14
  * GNU General Public License for more details.
... ...
@@ -17,9 +17,6 @@
17 17
  * along with this program; if not, write to the Free Software 
18 18
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
19 19
  * 
20
- * History:
21
- * --------
22
- *  2007-07-27  created by andrei
23 20
  */
24 21
 
25 22
 /*! \file
Browse code

parser: Fix parsing of Retry-After header

- Allow no space between duration and optional comment

Hugh Waite authored on 08/09/2014 16:46:55
Showing 1 changed files
... ...
@@ -59,6 +59,7 @@ char* parse_retry_after(char* const buf, const char* const end, unsigned* const
59 59
 				case ';':
60 60
 				case '\r':
61 61
 				case '\n':
62
+				case '(':
62 63
 					goto found;
63 64
 				default:
64 65
 					/* invalid char */
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
... ...
@@ -15,7 +15,7 @@
15 15
  *
16 16
  * You should have received a copy of the GNU General Public License 
17 17
  * along with this program; if not, write to the Free Software 
18
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
19 19
  * 
20 20
  * History:
21 21
  * --------
Browse code

parser: remove old $Id$ docs header from subversion times, not usable anymore

Henning Westerholt authored on 05/07/2012 21:39:51
Showing 1 changed files
... ...
@@ -1,6 +1,4 @@
1 1
 /* 
2
- * $Id$ 
3
- *
4 2
  * Copyright (C) 2007 iptelorg GmbH
5 3
  *
6 4
  * This file is part of ser, a free SIP server.
Browse code

parser: make get_hdr_field(..) and necessary called functions const-correct

Henning Westerholt authored on 05/07/2012 20:35:22
Showing 1 changed files
... ...
@@ -39,7 +39,7 @@
39 39
 #include "../mem/mem.h"
40 40
 
41 41
 /*! \brief Parse the Retry-after header field */
42
-char* parse_retry_after(char *buf, char* end, unsigned* after, int* err)
42
+char* parse_retry_after(char* const buf, const char* const end, unsigned* const after, int* const err)
43 43
 {
44 44
 	char *t;
45 45
 	int i;
Browse code

Doxygen changes

oej authored on 25/10/2009 18:30:31
Showing 1 changed files
... ...
@@ -10,11 +10,6 @@
10 10
  * the Free Software Foundation; either version 2 of the License, or
11 11
  * (at your option) any later version
12 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 13
  * ser is distributed in the hope that it will be useful,
19 14
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 15
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
... ...
@@ -29,6 +24,12 @@
29 24
  *  2007-07-27  created by andrei
30 25
  */
31 26
 
27
+/*! \file
28
+ * \brief Parser :: Retry-After: header parser
29
+ *
30
+ * \ingroup parser
31
+ */
32
+ 
32 33
 
33 34
 #include "../comp_defs.h"
34 35
 #include "parse_retry_after.h"
... ...
@@ -37,7 +38,7 @@
37 38
 #include "../dprint.h"
38 39
 #include "../mem/mem.h"
39 40
 
40
-/* Parse the Retry-after header field */
41
+/*! \brief Parse the Retry-after header field */
41 42
 char* parse_retry_after(char *buf, char* end, unsigned* after, int* err)
42 43
 {
43 44
 	char *t;
Browse code

- Retry-After parser missing files (from older commit)

Andrei Pelinescu-Onciul authored on 30/07/2007 20:19:31
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,95 @@
1
+/* 
2
+ * $Id$ 
3
+ *
4
+ * Copyright (C) 2007 iptelorg GmbH
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
26
+ * 
27
+ * History:
28
+ * --------
29
+ *  2007-07-27  created by andrei
30
+ */
31
+
32
+
33
+#include "../comp_defs.h"
34
+#include "parse_retry_after.h"
35
+#include "parser_f.h"  /* eat_space_end and so on */
36
+#include "parse_def.h"
37
+#include "../dprint.h"
38
+#include "../mem/mem.h"
39
+
40
+/* Parse the Retry-after header field */
41
+char* parse_retry_after(char *buf, char* end, unsigned* after, int* err)
42
+{
43
+	char *t;
44
+	int i;
45
+	unsigned val;
46
+	
47
+	val=0;
48
+	t=buf;
49
+	
50
+	t=eat_lws_end(t, end);
51
+	if (t>=end) goto error;
52
+	for (i=0; t<end; i++,t++){
53
+		if ((*t >= '0') && (*t <= '9')){
54
+			val=val*10+(*t-'0');
55
+		}else{
56
+			switch(*t){
57
+				/* for now we don't care about retry-after params or comment*/
58
+				case ' ':
59
+				case '\t':
60
+				case ';':
61
+				case '\r':
62
+				case '\n':
63
+					goto found;
64
+				default:
65
+					/* invalid char */
66
+					goto error;
67
+			}
68
+		}
69
+	}
70
+	goto error_nocrlf; /* end reached without encountering cr or lf */
71
+found:
72
+	if (i>10 || i==0) /* too many  or too few digits */
73
+		goto error;
74
+	*after=val;
75
+	/* find the end of header */
76
+	for (; t<end; t++){
77
+		if (*t=='\n'){
78
+			if (((t+1)<end) && (*(t+1)=='\r'))
79
+				t++;
80
+			if (((t+1)<end) && (*(t+1)==' ' || *(t+1)=='\t')){
81
+				t++;
82
+				continue; /* line folding ... */
83
+			}
84
+			*err=0;
85
+			return t+1;
86
+		}
87
+	}
88
+error_nocrlf:
89
+	LOG(L_ERR, "ERROR: parse_retry_after: strange EoHF\n");
90
+	goto error;
91
+error:
92
+	LOG(L_ERR, "ERROR: parse_retry_after: bad Retry-After header \n");
93
+	*err=1;
94
+	return t;
95
+}