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,98 +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
- * For a license to use the Kamailio 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
- * Kamailio is distributed in the hope that it will be useful,
17
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
- * GNU General Public License for more details.
20
- *
21
- * You should have received a copy of the GNU General Public License 
22
- * along with this program; if not, write to the Free Software 
23
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
24
- */
25
-
26
-/*! \file
27
- * \brief Parser :: SIP first line parsing automaton
28
- *
29
- * \ingroup parser
30
- */
31
-
32
-#ifndef PARSE_FLINE_H
33
-#define PARSE_FLINE_H
34
-
35
-#include "../str.h"
36
-
37
-/* Message is request */
38
-#define SIP_REQUEST 1
39
-
40
-/* Message is reply */
41
-#define SIP_REPLY   2
42
-
43
-/* Invalid message */
44
-#define SIP_INVALID 0
45
-
46
-#define SIP_VERSION "SIP/2.0"
47
-#define SIP_VERSION_LEN 7
48
-
49
-#define HTTP_VERSION "HTTP/1."
50
-#define HTTP_VERSION_LEN (sizeof(HTTP_VERSION)-1)
51
-
52
-#define CANCEL "CANCEL"
53
-#define ACK    "ACK"
54
-#define INVITE "INVITE"
55
-
56
-#define INVITE_LEN 6
57
-#define CANCEL_LEN 6
58
-#define ACK_LEN 3
59
-#define BYE_LEN 3
60
-#define INFO_LEN 4
61
-#define REGISTER_LEN 8
62
-#define SUBSCRIBE_LEN 9
63
-#define NOTIFY_LEN 6
64
-#define MESSAGE_LEN 7
65
-#define OPTIONS_LEN 7
66
-#define PRACK_LEN 5
67
-#define UPDATE_LEN 6
68
-#define REFER_LEN 5
69
-#define PUBLISH_LEN 7
70
-
71
-struct msg_start {
72
-	short type;					/*!< Type of the message - request/response */
73
-	short flags;				/*!< First line flags */
74
-	int len; 					/*!< length including delimiter */
75
-	union {
76
-		struct {
77
-			str method;       /*!< Method string */
78
-			str uri;          /*!< Request URI */
79
-			str version;      /*!< SIP version */
80
-			int method_value;
81
-		} request;
82
-		struct {
83
-			str version;      /*!< SIP version */
84
-			str status;       /*!< Reply status */
85
-			str reason;       /*!< Reply reason phrase */
86
-			unsigned int /*!< statusclass,*/ statuscode;
87
-		} reply;
88
-	}u;
89
-};
90
-
91
-
92
-
93
-char* parse_first_line(char* buffer, unsigned int len, struct msg_start * fl);
94
-
95
-char* parse_fline(char* buffer, char* end, struct msg_start* fl);
96
-
97
-
98
-#endif /* PARSE_FLINE_H */
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,19 +1,19 @@
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
11
+ * For a license to use the Kamailio software under conditions
12 12
  * other than those described here, or to purchase support for this
13 13
  * software, please contact iptel.org by e-mail at the following addresses:
14 14
  *    info@iptel.org
15 15
  *
16
- * ser is distributed in the hope that it will be useful,
16
+ * Kamailio is distributed in the hope that it will be useful,
17 17
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 18
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 19
  * GNU General Public License for more details.
Browse code

core: memset 0 the struct in first line parsing; split type and flags

- initialize to 0 first line struct msg_start_t in parse_first_line()
- split field int type in short type and short flags to be able to store
more info about first line without changes in other places of existing code
- set in flags if the protocol in first line is sip or http - useful to
avoid string comparison whenever needed to get the two very used
protocols

Daniel-Constantin Mierla authored on 07/01/2015 17:04:58
Showing 1 changed files
... ...
@@ -69,7 +69,8 @@
69 69
 #define PUBLISH_LEN 7
70 70
 
71 71
 struct msg_start {
72
-	int type;					/*!< Type of the Message - Request/Response */
72
+	short type;					/*!< Type of the message - request/response */
73
+	short flags;				/*!< First line flags */
73 74
 	int len; 					/*!< length including delimiter */
74 75
 	union {
75 76
 		struct {
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
 /*! \file
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

More parser/ doxygen changes

oej authored on 25/10/2009 17:26:46
Showing 1 changed files
... ...
@@ -25,6 +25,11 @@
25 25
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
26 26
  */
27 27
 
28
+/*! \file
29
+ * \brief Parser :: SIP first line parsing automaton
30
+ *
31
+ * \ingroup parser
32
+ */
28 33
 
29 34
 #ifndef PARSE_FLINE_H
30 35
 #define PARSE_FLINE_H
... ...
@@ -66,20 +71,20 @@
66 71
 #define PUBLISH_LEN 7
67 72
 
68 73
 struct msg_start {
69
-	int type;					/* Type of the Message - Request/Response */
70
-	int len; 					/* length including delimiter */
74
+	int type;					/*!< Type of the Message - Request/Response */
75
+	int len; 					/*!< length including delimiter */
71 76
 	union {
72 77
 		struct {
73
-			str method;       /* Method string */
74
-			str uri;          /* Request URI */
75
-			str version;      /* SIP version */
78
+			str method;       /*!< Method string */
79
+			str uri;          /*!< Request URI */
80
+			str version;      /*!< SIP version */
76 81
 			int method_value;
77 82
 		} request;
78 83
 		struct {
79
-			str version;      /* SIP version */
80
-			str status;       /* Reply status */
81
-			str reason;       /* Reply reason phrase */
82
-			unsigned int /* statusclass,*/ statuscode;
84
+			str version;      /*!< SIP version */
85
+			str status;       /*!< Reply status */
86
+			str reason;       /*!< Reply reason phrase */
87
+			unsigned int /*!< statusclass,*/ statuscode;
83 88
 		} reply;
84 89
 	}u;
85 90
 };
Browse code

core: PUBLISH and REFER recognized by first line parser

- still duplicity of getting the method - parse_metod() and macro by
parsing first line

Daniel-Constantin Mierla authored on 06/05/2009 18:53:56
Showing 1 changed files
... ...
@@ -62,6 +62,8 @@
62 62
 #define OPTIONS_LEN 7
63 63
 #define PRACK_LEN 5
64 64
 #define UPDATE_LEN 6
65
+#define REFER_LEN 5
66
+#define PUBLISH_LEN 7
65 67
 
66 68
 struct msg_start {
67 69
 	int type;					/* Type of the Message - Request/Response */
Browse code

Teach the parser recognize PRACK and UPDATE methods

Signed-off-by: Jan Janak <jan@iptel.org>

Ovidiu Sas authored on 23/03/2009 19:09:40 • Jan Janak committed on 23/03/2009 19:09:40
Showing 1 changed files
... ...
@@ -60,6 +60,8 @@
60 60
 #define NOTIFY_LEN 6
61 61
 #define MESSAGE_LEN 7
62 62
 #define OPTIONS_LEN 7
63
+#define PRACK_LEN 5
64
+#define UPDATE_LEN 6
63 65
 
64 66
 struct msg_start {
65 67
 	int type;					/* Type of the Message - Request/Response */
Browse code

Support for MESSAGE and OPTIONS method types are added to the parser.

Miklos Tirpak authored on 27/02/2009 09:01:42
Showing 1 changed files
... ...
@@ -58,6 +58,8 @@
58 58
 #define REGISTER_LEN 8
59 59
 #define SUBSCRIBE_LEN 9
60 60
 #define NOTIFY_LEN 6
61
+#define MESSAGE_LEN 7
62
+#define OPTIONS_LEN 7
61 63
 
62 64
 struct msg_start {
63 65
 	int type;					/* Type of the Message - Request/Response */
Browse code

- reverted the msg_start/first_line line memeber addition: almost the same effect can be obtained without adding another structure member which eats more memory, - added the SIP_MSG_START(msg) macro which has the same functions as the now removed msg->first_line.line.s

(this commit should also fix SER-248)

Andrei Pelinescu-Onciul authored on 14/03/2007 17:28:04
Showing 1 changed files
... ...
@@ -60,9 +60,8 @@
60 60
 #define NOTIFY_LEN 6
61 61
 
62 62
 struct msg_start {
63
-	int type;                         /* Type of the Message - Request/Response */
64
-	str line;                         /* len does not include CRLF, correct way how to point at second line is line.s+len */
65
-	int len; 						/* length including delimiter */
63
+	int type;					/* Type of the Message - Request/Response */
64
+	int len; 					/* length including delimiter */
66 65
 	union {
67 66
 		struct {
68 67
 			str method;       /* Method string */
... ...
@@ -80,6 +79,7 @@ struct msg_start {
80 79
 };
81 80
 
82 81
 
82
+
83 83
 char* parse_first_line(char* buffer, unsigned int len, struct msg_start * fl);
84 84
 
85 85
 char* parse_fline(char* buffer, char* end, struct msg_start* fl);
Browse code

- added (uint|int|str)_to_static_buffer functions to select_buffer - fixed minor bug in struct msg_start where is not known start of first line when empty lines preceed (sip_msg.buff points before them), so added line field holding correct position of first_line, fixed usage in textops and xmlrpc modules - added new select_core selects to resolve SER-158 - added new tm module select to resolve SER-158

Tomas Mandys authored on 18/02/2007 14:05:44
Showing 1 changed files
... ...
@@ -61,6 +61,7 @@
61 61
 
62 62
 struct msg_start {
63 63
 	int type;                         /* Type of the Message - Request/Response */
64
+	str line;                         /* len does not include CRLF, correct way how to point at second line is line.s+len */
64 65
 	int len; 						/* length including delimiter */
65 66
 	union {
66 67
 		struct {
Browse code

- numeric avp compared with string value fix: the value will be converted to int on-the-fly if possible (unfortunately we don't have enough information to do it on fixup).

- HTTP_VERSION_LEN macrodef. typo fix

Andrei Pelinescu-Onciul authored on 07/06/2006 21:55:25
Showing 1 changed files
... ...
@@ -44,7 +44,7 @@
44 44
 #define SIP_VERSION_LEN 7
45 45
 
46 46
 #define HTTP_VERSION "HTTP/1."
47
-#define HTTP_VERSION_LEN (sizeof(HTTP_VERSION - 1))
47
+#define HTTP_VERSION_LEN (sizeof(HTTP_VERSION)-1)
48 48
 
49 49
 #define CANCEL "CANCEL"
50 50
 #define ACK    "ACK"
Browse code

- support for REGISTER,SUBSCRIBE, and NOTIFY - removed code not being used (cvs history should be enough)

Jan Janak authored on 20/01/2006 11:19:43
Showing 1 changed files
... ...
@@ -55,7 +55,9 @@
55 55
 #define ACK_LEN 3
56 56
 #define BYE_LEN 3
57 57
 #define INFO_LEN 4
58
-
58
+#define REGISTER_LEN 8
59
+#define SUBSCRIBE_LEN 9
60
+#define NOTIFY_LEN 6
59 61
 
60 62
 struct msg_start {
61 63
 	int type;                         /* Type of the Message - Request/Response */
Browse code

- HTTP version macro

Jan Janak authored on 13/12/2005 00:41:18
Showing 1 changed files
... ...
@@ -43,6 +43,9 @@
43 43
 #define SIP_VERSION "SIP/2.0"
44 44
 #define SIP_VERSION_LEN 7
45 45
 
46
+#define HTTP_VERSION "HTTP/1."
47
+#define HTTP_VERSION_LEN (sizeof(HTTP_VERSION - 1))
48
+
46 49
 #define CANCEL "CANCEL"
47 50
 #define ACK    "ACK"
48 51
 #define INVITE "INVITE"
Browse code

- Maxim's INFO support patch (I forgot to apply it the first time)

Andrei Pelinescu-Onciul authored on 23/05/2005 09:20:57
Showing 1 changed files
... ...
@@ -51,6 +51,7 @@
51 51
 #define CANCEL_LEN 6
52 52
 #define ACK_LEN 3
53 53
 #define BYE_LEN 3
54
+#define INFO_LEN 4
54 55
 
55 56
 
56 57
 struct msg_start {
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
  *
Browse code

scratchpad removed, textops changed to skip the first line

Jiri Kuthan authored on 29/01/2003 19:24:10
Showing 1 changed files
... ...
@@ -55,6 +55,7 @@
55 55
 
56 56
 struct msg_start {
57 57
 	int type;                         /* Type of the Message - Request/Response */
58
+	int len; 						/* length including delimiter */
58 59
 	union {
59 60
 		struct {
60 61
 			str method;       /* Method string */
Browse code

GPLization banner introduced to *.[hc] files

Jiri Kuthan authored on 19/09/2002 12:23:52
Showing 1 changed files
... ...
@@ -1,7 +1,31 @@
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
 
28
+
5 29
 #ifndef PARSE_FLINE_H
6 30
 #define PARSE_FLINE_H
7 31
 
Browse code

cosmetic stuff

Jan Janak authored on 12/08/2002 12:15:49
Showing 1 changed files
... ...
@@ -2,8 +2,8 @@
2 2
  * $Id$
3 3
  */
4 4
 
5
-#ifndef PARSE_FLINE
6
-#define PARSE_FLINE
5
+#ifndef PARSE_FLINE_H
6
+#define PARSE_FLINE_H
7 7
 
8 8
 #include "../str.h"
9 9
 
... ...
@@ -53,4 +53,4 @@ char* parse_first_line(char* buffer, unsigned int len, struct msg_start * fl);
53 53
 char* parse_fline(char* buffer, char* end, struct msg_start* fl);
54 54
 
55 55
 
56
-#endif
56
+#endif /* PARSE_FLINE_H */
Browse code

parser directory cleanup

Jan Janak authored on 08/07/2002 17:53:33
Showing 1 changed files
... ...
@@ -7,16 +7,15 @@
7 7
 
8 8
 #include "../str.h"
9 9
 
10
-/* Message is a request */
10
+/* Message is request */
11 11
 #define SIP_REQUEST 1
12 12
 
13
-/* Message is a reply */
13
+/* Message is reply */
14 14
 #define SIP_REPLY   2
15 15
 
16 16
 /* Invalid message */
17 17
 #define SIP_INVALID 0
18 18
 
19
-
20 19
 #define SIP_VERSION "SIP/2.0"
21 20
 #define SIP_VERSION_LEN 7
22 21
 
... ...
@@ -29,6 +28,7 @@
29 28
 #define ACK_LEN 3
30 29
 #define BYE_LEN 3
31 30
 
31
+
32 32
 struct msg_start {
33 33
 	int type;                         /* Type of the Message - Request/Response */
34 34
 	union {
Browse code

parser directory cleanup

Jan Janak authored on 08/07/2002 17:14:39
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,56 @@
1
+/*
2
+ * $Id$
3
+ */
4
+
5
+#ifndef PARSE_FLINE
6
+#define PARSE_FLINE
7
+
8
+#include "../str.h"
9
+
10
+/* Message is a request */
11
+#define SIP_REQUEST 1
12
+
13
+/* Message is a reply */
14
+#define SIP_REPLY   2
15
+
16
+/* Invalid message */
17
+#define SIP_INVALID 0
18
+
19
+
20
+#define SIP_VERSION "SIP/2.0"
21
+#define SIP_VERSION_LEN 7
22
+
23
+#define CANCEL "CANCEL"
24
+#define ACK    "ACK"
25
+#define INVITE "INVITE"
26
+
27
+#define INVITE_LEN 6
28
+#define CANCEL_LEN 6
29
+#define ACK_LEN 3
30
+#define BYE_LEN 3
31
+
32
+struct msg_start {
33
+	int type;                         /* Type of the Message - Request/Response */
34
+	union {
35
+		struct {
36
+			str method;       /* Method string */
37
+			str uri;          /* Request URI */
38
+			str version;      /* SIP version */
39
+			int method_value;
40
+		} request;
41
+		struct {
42
+			str version;      /* SIP version */
43
+			str status;       /* Reply status */
44
+			str reason;       /* Reply reason phrase */
45
+			unsigned int /* statusclass,*/ statuscode;
46
+		} reply;
47
+	}u;
48
+};
49
+
50
+
51
+char* parse_first_line(char* buffer, unsigned int len, struct msg_start * fl);
52
+
53
+char* parse_fline(char* buffer, char* end, struct msg_start* fl);
54
+
55
+
56
+#endif