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,81 +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 Parser :: Parse name-addr part
24
- *
25
- * \ingroup parser
26
- */
27
-
28
-#include <string.h>
29
-#include "../dprint.h"
30
-#include "parse_nameaddr.h"
31
-#include "parser_f.h"
32
-#include "../ut.h"
33
-
34
-
35
-/*! \brief
36
- * Parse name-addr part, the given string can be longer,
37
- * parsing will stop when closing > is found
38
- */
39
-int parse_nameaddr(str* _s, name_addr_t* _a)
40
-{
41
-	char* uri_end;
42
-
43
-	if (!_s || !_a) {
44
-		return -1;
45
-	}
46
-
47
-	_a->name.s = _s->s;
48
-
49
-	_a->uri.s = find_not_quoted(_s, '<'); 
50
-	if (_a->uri.s) {
51
-		_a->name.len = _a->uri.s - _a->name.s;
52
-		_a->uri.s++; /* We will skip < character */
53
-	} else {
54
-		return -3;
55
-	}
56
-	
57
-	_a->uri.len = _s->len - _a->name.len - 1;
58
-	uri_end = find_not_quoted(&_a->uri, '>');
59
-	
60
-	if (!uri_end) {
61
-		return -4;
62
-	}
63
-	/* Total length of the field including <> */
64
-	_a->len = uri_end - _a->name.s + 1;
65
-	
66
-	_a->uri.len = uri_end - _a->uri.s;
67
-	return 0;
68
-}
69
-
70
-
71
-/*! \brief
72
- * Print a name-addr structure, just for debugging
73
- */
74
-void print_nameaddr(FILE* _o, name_addr_t* _a)
75
-{
76
-	fprintf(_o, "---name-addr---\n");
77
-	fprintf(_o, "name: '%.*s'\n", _a->name.len, ZSW(_a->name.s));
78
-	fprintf(_o, "uri : '%.*s'\n", _a->uri.len, ZSW(_a->uri.s));
79
-	fprintf(_o, "len : %d\n", _a->len);
80
-	fprintf(_o, "---/name-addr---\n");
81
-}
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) 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
- * 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,10 +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
- * 2003-03-24 Created by janakj
23
- * 2003-04-26 ZSW (jiri)
24 20
  */
25 21
 
26 22
 /*! \file
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) 2001-2003 FhG Fokus
5 3
  *
6 4
  * This file is part of ser, a free SIP server.
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
... ...
@@ -30,6 +25,12 @@
30 25
  * 2003-04-26 ZSW (jiri)
31 26
  */
32 27
 
28
+/*! \file
29
+ * \brief Parser :: Parse name-addr part
30
+ *
31
+ * \ingroup parser
32
+ */
33
+
33 34
 #include <string.h>
34 35
 #include "../dprint.h"
35 36
 #include "parse_nameaddr.h"
... ...
@@ -37,7 +38,7 @@
37 38
 #include "../ut.h"
38 39
 
39 40
 
40
-/*
41
+/*! \brief
41 42
  * Parse name-addr part, the given string can be longer,
42 43
  * parsing will stop when closing > is found
43 44
  */
... ...
@@ -73,7 +74,7 @@ int parse_nameaddr(str* _s, name_addr_t* _a)
73 74
 }
74 75
 
75 76
 
76
-/*
77
+/*! \brief
77 78
  * Print a name-addr structure, just for debugging
78 79
  */
79 80
 void print_nameaddr(FILE* _o, name_addr_t* _a)
Browse code

- parse_nameaddr doesn't log any error messages anymore (sometimes it's called to check if a string is in nameaddr format, for example from the avp module) - if parse_nameaddr fails in parse_rr, parse_rr will log the failed "uri".

Andrei Pelinescu-Onciul authored on 06/06/2008 12:12:33
Showing 1 changed files
... ...
@@ -46,7 +46,6 @@ int parse_nameaddr(str* _s, name_addr_t* _a)
46 46
 	char* uri_end;
47 47
 
48 48
 	if (!_s || !_a) {
49
-		LOG(L_ERR, "parse_nameaddr(): Invalid parameter value\n");
50 49
 		return -1;
51 50
 	}
52 51
 
... ...
@@ -57,8 +56,6 @@ int parse_nameaddr(str* _s, name_addr_t* _a)
57 56
 		_a->name.len = _a->uri.s - _a->name.s;
58 57
 		_a->uri.s++; /* We will skip < character */
59 58
 	} else {
60
-		LOG(L_ERR, "parse_nameaddr(): No < found in (%.*s)\n", _s->len,
61
-					ZSW(_s->s));
62 59
 		return -3;
63 60
 	}
64 61
 	
... ...
@@ -66,12 +63,9 @@ int parse_nameaddr(str* _s, name_addr_t* _a)
66 63
 	uri_end = find_not_quoted(&_a->uri, '>');
67 64
 	
68 65
 	if (!uri_end) {
69
-		LOG(L_ERR, "parse_nameaddr(): No > found in (%.*s)\n", _s->len,
70
-					ZSW(_s->s));
71 66
 		return -4;
72 67
 	}
73
-
74
-	     /* Total length of the field including <> */
68
+	/* Total length of the field including <> */
75 69
 	_a->len = uri_end - _a->name.s + 1;
76 70
 	
77 71
 	_a->uri.len = uri_end - _a->uri.s;
Browse code

- be more verbose when parse_nameaddr fails (show the guilty string). Patch from Alfred E. Heggestad <aeh@db.org>.

Andrei Pelinescu-Onciul authored on 06/06/2008 11:49:18
Showing 1 changed files
... ...
@@ -57,7 +57,8 @@ int parse_nameaddr(str* _s, name_addr_t* _a)
57 57
 		_a->name.len = _a->uri.s - _a->name.s;
58 58
 		_a->uri.s++; /* We will skip < character */
59 59
 	} else {
60
-		LOG(L_ERR, "parse_nameaddr(): No < found\n");
60
+		LOG(L_ERR, "parse_nameaddr(): No < found in (%.*s)\n", _s->len,
61
+					ZSW(_s->s));
61 62
 		return -3;
62 63
 	}
63 64
 	
... ...
@@ -65,7 +66,8 @@ int parse_nameaddr(str* _s, name_addr_t* _a)
65 66
 	uri_end = find_not_quoted(&_a->uri, '>');
66 67
 	
67 68
 	if (!uri_end) {
68
-		LOG(L_ERR, "parse_nameaddr(): No > found\n");
69
+		LOG(L_ERR, "parse_nameaddr(): No > found in (%.*s)\n", _s->len,
70
+					ZSW(_s->s));
69 71
 		return -4;
70 72
 	}
71 73
 
Browse code

- Spelling checked

Jan Janak authored on 24/08/2004 09:01:24
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
  *
... ...
@@ -69,7 +69,7 @@ int parse_nameaddr(str* _s, name_addr_t* _a)
69 69
 		return -4;
70 70
 	}
71 71
 
72
-	     /* Totat length of the field including <> */
72
+	     /* Total length of the field including <> */
73 73
 	_a->len = uri_end - _a->name.s + 1;
74 74
 	
75 75
 	_a->uri.len = uri_end - _a->uri.s;
Browse code

Missleading comment fixed.

Jan Janak authored on 09/02/2004 14:25:04
Showing 1 changed files
... ...
@@ -39,7 +39,7 @@
39 39
 
40 40
 /*
41 41
  * Parse name-addr part, the given string can be longer,
42
- * it will be updated to point right behind the name-addr part
42
+ * parsing will stop when closing > is found
43 43
  */
44 44
 int parse_nameaddr(str* _s, name_addr_t* _a)
45 45
 {
Browse code

- minor bugs fixed

Jan Janak authored on 28/04/2003 22:08:52
Showing 1 changed files
... ...
@@ -85,5 +85,6 @@ void print_nameaddr(FILE* _o, name_addr_t* _a)
85 85
 	fprintf(_o, "---name-addr---\n");
86 86
 	fprintf(_o, "name: '%.*s'\n", _a->name.len, ZSW(_a->name.s));
87 87
 	fprintf(_o, "uri : '%.*s'\n", _a->uri.len, ZSW(_a->uri.s));
88
+	fprintf(_o, "len : %d\n", _a->len);
88 89
 	fprintf(_o, "---/name-addr---\n");
89 90
 }
Browse code

ZSW introduced to deal with solaris printf("%.*s",0,0) SF

Jiri Kuthan authored on 26/04/2003 20:28:46
Showing 1 changed files
... ...
@@ -27,12 +27,14 @@
27 27
  * History
28 28
  * --------
29 29
  * 2003-03-24 Created by janakj
30
+ * 2003-04-26 ZSW (jiri)
30 31
  */
31 32
 
32 33
 #include <string.h>
33 34
 #include "../dprint.h"
34 35
 #include "parse_nameaddr.h"
35 36
 #include "parser_f.h"
37
+#include "../ut.h"
36 38
 
37 39
 
38 40
 /*
... ...
@@ -81,7 +83,7 @@ int parse_nameaddr(str* _s, name_addr_t* _a)
81 83
 void print_nameaddr(FILE* _o, name_addr_t* _a)
82 84
 {
83 85
 	fprintf(_o, "---name-addr---\n");
84
-	fprintf(_o, "name: '%.*s'\n", _a->name.len, _a->name.s);
85
-	fprintf(_o, "uri : '%.*s'\n", _a->uri.len, _a->uri.s);
86
+	fprintf(_o, "name: '%.*s'\n", _a->name.len, ZSW(_a->name.s));
87
+	fprintf(_o, "uri : '%.*s'\n", _a->uri.len, ZSW(_a->uri.s));
86 88
 	fprintf(_o, "---/name-addr---\n");
87 89
 }
Browse code

- print_* function don't use stdout anymore

Jan Janak authored on 10/04/2003 12:38:18
Showing 1 changed files
... ...
@@ -29,7 +29,6 @@
29 29
  * 2003-03-24 Created by janakj
30 30
  */
31 31
 
32
-#include <stdio.h>
33 32
 #include <string.h>
34 33
 #include "../dprint.h"
35 34
 #include "parse_nameaddr.h"
... ...
@@ -79,10 +78,10 @@ int parse_nameaddr(str* _s, name_addr_t* _a)
79 78
 /*
80 79
  * Print a name-addr structure, just for debugging
81 80
  */
82
-void print_nameaddr(name_addr_t* _a)
81
+void print_nameaddr(FILE* _o, name_addr_t* _a)
83 82
 {
84
-	printf("---name-addr---\n");
85
-	printf("name: '%.*s'\n", _a->name.len, _a->name.s);
86
-	printf("uri : '%.*s'\n", _a->uri.len, _a->uri.s);
87
-	printf("---/name-addr---\n");
83
+	fprintf(_o, "---name-addr---\n");
84
+	fprintf(_o, "name: '%.*s'\n", _a->name.len, _a->name.s);
85
+	fprintf(_o, "uri : '%.*s'\n", _a->uri.len, _a->uri.s);
86
+	fprintf(_o, "---/name-addr---\n");
88 87
 }
Browse code

Totat lenght of the structure added.

Jan Janak authored on 31/03/2003 10:27:36
Showing 1 changed files
... ...
@@ -35,6 +35,7 @@
35 35
 #include "parse_nameaddr.h"
36 36
 #include "parser_f.h"
37 37
 
38
+
38 39
 /*
39 40
  * Parse name-addr part, the given string can be longer,
40 41
  * it will be updated to point right behind the name-addr part
... ...
@@ -66,6 +67,9 @@ int parse_nameaddr(str* _s, name_addr_t* _a)
66 67
 		LOG(L_ERR, "parse_nameaddr(): No > found\n");
67 68
 		return -4;
68 69
 	}
70
+
71
+	     /* Totat length of the field including <> */
72
+	_a->len = uri_end - _a->name.s + 1;
69 73
 	
70 74
 	_a->uri.len = uri_end - _a->uri.s;
71 75
 	return 0;
Browse code

- find_not_quoted added to parser_f - minor bugs fixed in parse_nameaddr.c

Jan Janak authored on 25/03/2003 22:39:26
Showing 1 changed files
... ...
@@ -48,8 +48,6 @@ int parse_nameaddr(str* _s, name_addr_t* _a)
48 48
 		return -1;
49 49
 	}
50 50
 
51
-	memset(_a, 0, sizeof(name_addr_t));
52
-
53 51
 	_a->name.s = _s->s;
54 52
 
55 53
 	_a->uri.s = find_not_quoted(_s, '<'); 
Browse code

name-addr (see RFC3261) parser

Jan Janak authored on 24/03/2003 16:42:21
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,86 @@
1
+/* 
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
26
+ *
27
+ * History
28
+ * --------
29
+ * 2003-03-24 Created by janakj
30
+ */
31
+
32
+#include <stdio.h>
33
+#include <string.h>
34
+#include "../dprint.h"
35
+#include "parse_nameaddr.h"
36
+#include "parser_f.h"
37
+
38
+/*
39
+ * Parse name-addr part, the given string can be longer,
40
+ * it will be updated to point right behind the name-addr part
41
+ */
42
+int parse_nameaddr(str* _s, name_addr_t* _a)
43
+{
44
+	char* uri_end;
45
+
46
+	if (!_s || !_a) {
47
+		LOG(L_ERR, "parse_nameaddr(): Invalid parameter value\n");
48
+		return -1;
49
+	}
50
+
51
+	memset(_a, 0, sizeof(name_addr_t));
52
+
53
+	_a->name.s = _s->s;
54
+
55
+	_a->uri.s = find_not_quoted(_s, '<'); 
56
+	if (_a->uri.s) {
57
+		_a->name.len = _a->uri.s - _a->name.s;
58
+		_a->uri.s++; /* We will skip < character */
59
+	} else {
60
+		LOG(L_ERR, "parse_nameaddr(): No < found\n");
61
+		return -3;
62
+	}
63
+	
64
+	_a->uri.len = _s->len - _a->name.len - 1;
65
+	uri_end = find_not_quoted(&_a->uri, '>');
66
+	
67
+	if (!uri_end) {
68
+		LOG(L_ERR, "parse_nameaddr(): No > found\n");
69
+		return -4;
70
+	}
71
+	
72
+	_a->uri.len = uri_end - _a->uri.s;
73
+	return 0;
74
+}
75
+
76
+
77
+/*
78
+ * Print a name-addr structure, just for debugging
79
+ */
80
+void print_nameaddr(name_addr_t* _a)
81
+{
82
+	printf("---name-addr---\n");
83
+	printf("name: '%.*s'\n", _a->name.len, _a->name.s);
84
+	printf("uri : '%.*s'\n", _a->uri.len, _a->uri.s);
85
+	printf("---/name-addr---\n");
86
+}