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,49 +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
-/*! \file
22
- * \brief Parser :: Parse To: header
23
- *
24
- * \ingroup parser
25
- */
26
-
27
-#ifndef PARSE_TO
28
-#define PARSE_TO
29
-
30
-#include "../str.h"
31
-#include "msg_parser.h"
32
-#include "parse_addr_spec.h"
33
-
34
-/* casting macro for accessing To body */
35
-#define get_to(p_msg)      ((struct to_body*)(p_msg)->to->parsed)
36
-
37
-#define GET_TO_PURI(p_msg) \
38
-	(&((struct to_body*)(p_msg)->to->parsed)->parsed_uri)
39
-
40
-/*! \brief
41
- * To header field parser
42
- */
43
-char* parse_to(char* const buffer, const char* const end, struct to_body* const to_b);
44
-
45
-int parse_to_header(struct sip_msg* const msg);
46
-
47
-sip_uri_t *parse_to_uri(struct sip_msg* const msg);
48
-
49
-#endif
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.
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
 
21 21
 /*! \file
Browse code

parser,modules/pv,modules/sipcapture: Improved parsing of P-Asserted/Preferred-Identity headers

parser:
- Abstracted addr-spec parsing from parse_to.c into new file.
(parse_addr_spec.c)
- Added support for comma separated addr-spec values.
- Created new P-Asserted-Identity and P-Preferred-Identity header parsers
that parse all instances and allows comma separated values.
modules/pv:
- Added PV index to $ai, $pu, $pU, $pd and $pn variables to retreive the
n'th URI instance. E.g. $(ai[1])
modules/sipcapture:
- Updated to use the new structure
- Maintains previous behaviour - only uses the first URI

Hugh Waite authored on 11/03/2013 16:55:23
Showing 1 changed files
... ...
@@ -29,30 +29,7 @@
29 29
 
30 30
 #include "../str.h"
31 31
 #include "msg_parser.h"
32
-
33
-enum {
34
-	TAG_PARAM = 400, GENERAL_PARAM
35
-};
36
-
37
-typedef struct to_param{
38
-	int type;              /*!< Type of parameter */
39
-	str name;              /*!< Name of parameter */
40
-	str value;             /*!< Parameter value */
41
-	struct to_param* next; /*!< Next parameter in the list */
42
-} to_param_t;
43
-
44
-
45
-typedef struct to_body{
46
-	int error;                    /*!< Error code */
47
-	str body;                     /*!< The whole header field body */
48
-	str uri;                      /*!< URI */
49
-	str display;				  /*!< Display Name */
50
-	str tag_value;                /*!< Value of tag */
51
-	struct sip_uri parsed_uri;
52
-	struct to_param *param_lst;   /*!< Linked list of parameters */
53
-	struct to_param *last_param;  /*!< Last parameter in the list */
54
-} to_body_t;
55
-
32
+#include "parse_addr_spec.h"
56 33
 
57 34
 /* casting macro for accessing To body */
58 35
 #define get_to(p_msg)      ((struct to_body*)(p_msg)->to->parsed)
... ...
@@ -65,10 +42,6 @@ typedef struct to_body{
65 42
  */
66 43
 char* parse_to(char* const buffer, const char* const end, struct to_body* const to_b);
67 44
 
68
-void free_to_params(struct to_body* const tb);
69
-
70
-void free_to(struct to_body* const tb);
71
-
72 45
 int parse_to_header(struct sip_msg* const msg);
73 46
 
74 47
 sip_uri_t *parse_to_uri(struct sip_msg* const msg);
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

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
... ...
@@ -65,14 +65,14 @@ typedef struct to_body{
65 65
 /*! \brief
66 66
  * To header field parser
67 67
  */
68
-char* parse_to(char* buffer, char *end, struct to_body *to_b);
68
+char* parse_to(char* const buffer, const char* const end, struct to_body* const to_b);
69 69
 
70
-void free_to_params(struct to_body* tb);
70
+void free_to_params(struct to_body* const tb);
71 71
 
72
-void free_to(struct to_body* tb);
72
+void free_to(struct to_body* const tb);
73 73
 
74
-int parse_to_header(struct sip_msg *msg);
74
+int parse_to_header(struct sip_msg* const msg);
75 75
 
76
-sip_uri_t *parse_to_uri(struct sip_msg* msg);
76
+sip_uri_t *parse_to_uri(struct sip_msg* const msg);
77 77
 
78 78
 #endif
Browse code

parser: relocated helper functions

Daniel-Constantin Mierla authored on 10/01/2012 22:33:00
Showing 1 changed files
... ...
@@ -73,4 +73,6 @@ void free_to(struct to_body* tb);
73 73
 
74 74
 int parse_to_header(struct sip_msg *msg);
75 75
 
76
+sip_uri_t *parse_to_uri(struct sip_msg* msg);
77
+
76 78
 #endif
Browse code

parser: typedef'ed To structures

Daniel-Constantin Mierla authored on 10/01/2012 22:07:04
Showing 1 changed files
... ...
@@ -36,15 +36,15 @@ enum {
36 36
 	TAG_PARAM = 400, GENERAL_PARAM
37 37
 };
38 38
 
39
-struct to_param{
39
+typedef struct to_param{
40 40
 	int type;              /*!< Type of parameter */
41 41
 	str name;              /*!< Name of parameter */
42 42
 	str value;             /*!< Parameter value */
43 43
 	struct to_param* next; /*!< Next parameter in the list */
44
-};
44
+} to_param_t;
45 45
 
46 46
 
47
-struct to_body{
47
+typedef struct to_body{
48 48
 	int error;                    /*!< Error code */
49 49
 	str body;                     /*!< The whole header field body */
50 50
 	str uri;                      /*!< URI */
... ...
@@ -53,7 +53,7 @@ struct to_body{
53 53
 	struct sip_uri parsed_uri;
54 54
 	struct to_param *param_lst;   /*!< Linked list of parameters */
55 55
 	struct to_param *last_param;  /*!< Last parameter in the list */
56
-};
56
+} to_body_t;
57 57
 
58 58
 
59 59
 /* casting macro for accessing To body */
Browse code

core: defines to return parsed uri in From and To

Daniel-Constantin Mierla authored on 05/01/2011 17:55:54
Showing 1 changed files
... ...
@@ -57,8 +57,10 @@ struct to_body{
57 57
 
58 58
 
59 59
 /* casting macro for accessing To body */
60
-#define get_to( p_msg)      ((struct to_body*)(p_msg)->to->parsed)
60
+#define get_to(p_msg)      ((struct to_body*)(p_msg)->to->parsed)
61 61
 
62
+#define GET_TO_PURI(p_msg) \
63
+	(&((struct to_body*)(p_msg)->to->parsed)->parsed_uri)
62 64
 
63 65
 /*! \brief
64 66
  * To header field parser
Browse code

core: parse_to_header() moved to parser/parse_to.{c,h}

- more convenient way of testing the validity of To header

Daniel-Constantin Mierla authored on 05/01/2011 15:23:44
Showing 1 changed files
... ...
@@ -69,5 +69,6 @@ void free_to_params(struct to_body* tb);
69 69
 
70 70
 void free_to(struct to_body* tb);
71 71
 
72
+int parse_to_header(struct sip_msg *msg);
72 73
 
73 74
 #endif
Browse code

Doxygen updates

oej authored on 25/10/2009 19:11:28
Showing 1 changed files
... ...
@@ -26,9 +26,6 @@
26 26
  * \ingroup parser
27 27
  */
28 28
 
29
-#include "parse_to.h"
30
-
31
-
32 29
 #ifndef PARSE_TO
33 30
 #define PARSE_TO
34 31
 
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
... ...
@@ -25,6 +20,14 @@
25 20
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
26 21
  */
27 22
 
23
+/*! \file
24
+ * \brief Parser :: Parse To: header
25
+ *
26
+ * \ingroup parser
27
+ */
28
+
29
+#include "parse_to.h"
30
+
28 31
 
29 32
 #ifndef PARSE_TO
30 33
 #define PARSE_TO
... ...
@@ -37,22 +40,22 @@ enum {
37 40
 };
38 41
 
39 42
 struct to_param{
40
-	int type;              /* Type of parameter */
41
-	str name;              /* Name of parameter */
42
-	str value;             /* Parameter value */
43
-	struct to_param* next; /* Next parameter in the list */
43
+	int type;              /*!< Type of parameter */
44
+	str name;              /*!< Name of parameter */
45
+	str value;             /*!< Parameter value */
46
+	struct to_param* next; /*!< Next parameter in the list */
44 47
 };
45 48
 
46 49
 
47 50
 struct to_body{
48
-	int error;                    /* Error code */
49
-	str body;                     /* The whole header field body */
50
-	str uri;                      /* URI */
51
-	str display;				  /* Display Name */
52
-	str tag_value;                /* Value of tag */
51
+	int error;                    /*!< Error code */
52
+	str body;                     /*!< The whole header field body */
53
+	str uri;                      /*!< URI */
54
+	str display;				  /*!< Display Name */
55
+	str tag_value;                /*!< Value of tag */
53 56
 	struct sip_uri parsed_uri;
54
-	struct to_param *param_lst;   /* Linked list of parameters */
55
-	struct to_param *last_param;  /* Last parameter in the list */
57
+	struct to_param *param_lst;   /*!< Linked list of parameters */
58
+	struct to_param *last_param;  /*!< Last parameter in the list */
56 59
 };
57 60
 
58 61
 
... ...
@@ -60,7 +63,7 @@ struct to_body{
60 63
 #define get_to( p_msg)      ((struct to_body*)(p_msg)->to->parsed)
61 64
 
62 65
 
63
-/*
66
+/*! \brief
64 67
  * To header field parser
65 68
  */
66 69
 char* parse_to(char* buffer, char *end, struct to_body *to_b);
Browse code

Split free_to to two functions: free_to_params and free_to.

This patch splits the function free_to to two functions, free_to_params
which only destroys the linked list of parameters and free_to which
calls free_to_params internally and also frees the entire to header
structure.

Jan Janak authored on 15/03/2009 20:02:57
Showing 1 changed files
... ...
@@ -65,6 +65,7 @@ struct to_body{
65 65
  */
66 66
 char* parse_to(char* buffer, char *end, struct to_body *to_b);
67 67
 
68
+void free_to_params(struct to_body* tb);
68 69
 
69 70
 void free_to(struct to_body* tb);
70 71
 
Browse code

Add parsed_uri structure to the to_body structure.

This is a compatiblity change inspired by kamailio changes. It makes
it possible to store already parsed to and from URIs in the sip
message structure and there is no need to reparse such URIs later.
To and From headers are often parsed repeatedly in modules.

As a side effect I had to avoid a nasty cyclic dependency in parser
headers. I removed parse_to from msg_parser.h, the header does not have
to be included there because nothing in msg_parser.h uses stuff from
parse_to. In addition to that many files that previously included only
msg_parser.h, and assumed that the header would pull parse_to.h as well,
needed to be modified to include parse_to.h explicitly.

Jan Janak authored on 05/03/2009 22:47:02
Showing 1 changed files
... ...
@@ -30,6 +30,7 @@
30 30
 #define PARSE_TO
31 31
 
32 32
 #include "../str.h"
33
+#include "msg_parser.h"
33 34
 
34 35
 enum {
35 36
 	TAG_PARAM = 400, GENERAL_PARAM
... ...
@@ -49,6 +50,7 @@ struct to_body{
49 50
 	str uri;                      /* URI */
50 51
 	str display;				  /* Display Name */
51 52
 	str tag_value;                /* Value of tag */
53
+	struct sip_uri parsed_uri;
52 54
 	struct to_param *param_lst;   /* Linked list of parameters */
53 55
 	struct to_param *last_param;  /* Last parameter in the list */
54 56
 };
Browse code

display name marking introduced to To HF parser

Jiri Kuthan authored on 27/09/2004 04:02:25
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
  *
... ...
@@ -47,6 +47,7 @@ struct to_body{
47 47
 	int error;                    /* Error code */
48 48
 	str body;                     /* The whole header field body */
49 49
 	str uri;                      /* URI */
50
+	str display;				  /* Display Name */
50 51
 	str tag_value;                /* Value of tag */
51 52
 	struct to_param *param_lst;   /* Linked list of parameters */
52 53
 	struct to_param *last_param;  /* Last parameter in the list */
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

param type enum moved into the header file.

Jan Janak authored on 30/03/2003 20:33:29
Showing 1 changed files
... ...
@@ -31,6 +31,10 @@
31 31
 
32 32
 #include "../str.h"
33 33
 
34
+enum {
35
+	TAG_PARAM = 400, GENERAL_PARAM
36
+};
37
+
34 38
 struct to_param{
35 39
 	int type;              /* Type of parameter */
36 40
 	str name;              /* Name of parameter */
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_TO
6 30
 #define PARSE_TO
7 31
 
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,41 @@
1
+/*
2
+ * $Id$
3
+ */
4
+
5
+#ifndef PARSE_TO
6
+#define PARSE_TO
7
+
8
+#include "../str.h"
9
+
10
+struct to_param{
11
+	int type;              /* Type of parameter */
12
+	str name;              /* Name of parameter */
13
+	str value;             /* Parameter value */
14
+	struct to_param* next; /* Next parameter in the list */
15
+};
16
+
17
+
18
+struct to_body{
19
+	int error;                    /* Error code */
20
+	str body;                     /* The whole header field body */
21
+	str uri;                      /* URI */
22
+	str tag_value;                /* Value of tag */
23
+	struct to_param *param_lst;   /* Linked list of parameters */
24
+	struct to_param *last_param;  /* Last parameter in the list */
25
+};
26
+
27
+
28
+/* casting macro for accessing To body */
29
+#define get_to( p_msg)      ((struct to_body*)(p_msg)->to->parsed)
30
+
31
+
32
+/*
33
+ * To header field parser
34
+ */
35
+char* parse_to(char* buffer, char *end, struct to_body *to_b);
36
+
37
+
38
+void free_to(struct to_body* tb);
39
+
40
+
41
+#endif