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,114 +0,0 @@
1
-/*
2
- * Copyright (C) 2013 Daniel-Constantin Mierla (asipto.com)
3
- *
4
- * This file is part of Kamailio, a free SIP server.
5
- *
6
- * Permission to use, copy, modify, and distribute this software for any
7
- * purpose with or without fee is hereby granted, provided that the above
8
- * copyright notice and this permission notice appear in all copies.
9
- *
10
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17
- */
18
-
19
-/*!
20
- * \file
21
- * \brief Kamailio core :: SCTP support
22
- * \ingroup core
23
- * Module: \ref core
24
- */
25
-
26
-#include "sctp_core.h"
27
-
28
-/**
29
- *
30
- */
31
-static sctp_srapi_t _sctp_srapi = { 0 };
32
-static int _sctp_srapi_set = 0;
33
-
34
-/**
35
- *
36
- */
37
-int sctp_core_init(void)
38
-{
39
-	if(_sctp_srapi_set==0) {
40
-		LM_ERR("SCTP API not initialized\n");
41
-		return -1;
42
-	}
43
-
44
-	return _sctp_srapi.init();
45
-}
46
-
47
-/**
48
- *
49
- */
50
-void sctp_core_destroy(void)
51
-{
52
-	if(_sctp_srapi_set==0) {
53
-		LM_INFO("SCTP API not initialized\n");
54
-		return;
55
-	}
56
-
57
-	_sctp_srapi.destroy();
58
-}
59
-
60
-/**
61
- *
62
- */
63
-int sctp_core_init_sock(struct socket_info* sock_info)
64
-{
65
-	return _sctp_srapi.init_sock(sock_info);
66
-}
67
-
68
-/**
69
- *
70
- */
71
-int sctp_core_check_support(void)
72
-{
73
-	if(_sctp_srapi_set==0) {
74
-		LM_INFO("SCTP API not enabled"
75
-				" - if you want to use it, load sctp module\n");
76
-		return -1;
77
-	}
78
-
79
-	return _sctp_srapi.check_support();
80
-}
81
-
82
-/**
83
- *
84
- */
85
-int sctp_core_rcv_loop(void)
86
-{
87
-	return _sctp_srapi.rcv_loop();
88
-}
89
-
90
-/**
91
- *
92
- */
93
-int sctp_core_msg_send(struct dest_info* dst, char* buf, unsigned len)
94
-{
95
-	return _sctp_srapi.msg_send(dst, buf, len);
96
-}
97
-
98
-/**
99
- *
100
- */
101
-int sctp_core_register_api(sctp_srapi_t *api)
102
-{
103
-	if(api==NULL || api->init==NULL) {
104
-		LM_ERR("invalid parameters\n");
105
-		return -1;
106
-	}
107
-	if(_sctp_srapi_set==1) {
108
-		LM_ERR("SCTP API already initialized\n");
109
-		return -1;
110
-	}
111
-	_sctp_srapi_set = 1;
112
-	memcpy(&_sctp_srapi, api, sizeof(sctp_srapi_t));
113
-	return 0;
114
-}
Browse code

Core Removed history, svn $id$ and doxygen udpates on the .c files

Olle E. Johansson authored on 03/01/2015 09:53:17
Showing 1 changed files
... ...
@@ -1,6 +1,4 @@
1
-/**
2
- * $Id$
3
- *
1
+/*
4 2
  * Copyright (C) 2013 Daniel-Constantin Mierla (asipto.com)
5 3
  *
6 4
  * This file is part of Kamailio, a free SIP server.
... ...
@@ -18,6 +16,13 @@
18 16
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 17
  */
20 18
 
19
+/*!
20
+ * \file
21
+ * \brief Kamailio core :: SCTP support
22
+ * \ingroup core
23
+ * Module: \ref core
24
+ */
25
+
21 26
 #include "sctp_core.h"
22 27
 
23 28
 /**
Browse code

core: safety check for initialized SCTP API

- reported by Juha Heinanen

Daniel-Constantin Mierla authored on 26/05/2013 08:12:24
Showing 1 changed files
... ...
@@ -65,6 +65,12 @@ int sctp_core_init_sock(struct socket_info* sock_info)
65 65
  */
66 66
 int sctp_core_check_support(void)
67 67
 {
68
+	if(_sctp_srapi_set==0) {
69
+		LM_INFO("SCTP API not enabled"
70
+				" - if you want to use it, load sctp module\n");
71
+		return -1;
72
+	}
73
+
68 74
 	return _sctp_srapi.check_support();
69 75
 }
70 76
 
Browse code

core: filled sctp core api

- cleanup of not needed members

Daniel-Constantin Mierla authored on 25/05/2013 13:42:14
Showing 1 changed files
... ...
@@ -44,29 +44,20 @@ int sctp_core_init(void)
44 44
  */
45 45
 void sctp_core_destroy(void)
46 46
 {
47
-}
48
-
49
-/**
50
- *
51
- */
52
-int sctp_core_init_sock(struct socket_info* sock_info)
53
-{
54
-	return 0;
55
-}
47
+	if(_sctp_srapi_set==0) {
48
+		LM_INFO("SCTP API not initialized\n");
49
+		return;
50
+	}
56 51
 
57
-/**
58
- *
59
- */
60
-void sctp_core_init_options(void)
61
-{
52
+	_sctp_srapi.destroy();
62 53
 }
63 54
 
64 55
 /**
65 56
  *
66 57
  */
67
-int sctp_core_check_compiled_sockopts(char* buf, int size)
58
+int sctp_core_init_sock(struct socket_info* sock_info)
68 59
 {
69
-	return 0;
60
+	return _sctp_srapi.init_sock(sock_info);
70 61
 }
71 62
 
72 63
 /**
... ...
@@ -74,7 +65,7 @@ int sctp_core_check_compiled_sockopts(char* buf, int size)
74 65
  */
75 66
 int sctp_core_check_support(void)
76 67
 {
77
-	return 0;
68
+	return _sctp_srapi.check_support();
78 69
 }
79 70
 
80 71
 /**
... ...
@@ -82,7 +73,7 @@ int sctp_core_check_support(void)
82 73
  */
83 74
 int sctp_core_rcv_loop(void)
84 75
 {
85
-	return 0;
76
+	return _sctp_srapi.rcv_loop();
86 77
 }
87 78
 
88 79
 /**
... ...
@@ -90,7 +81,7 @@ int sctp_core_rcv_loop(void)
90 81
  */
91 82
 int sctp_core_msg_send(struct dest_info* dst, char* buf, unsigned len)
92 83
 {
93
-	return 0;
84
+	return _sctp_srapi.msg_send(dst, buf, len);
94 85
 }
95 86
 
96 87
 /**
Browse code

core: added sctp callbacks api

- functions needed in core - callbacks to be set by sctp module

Daniel-Constantin Mierla authored on 25/05/2013 08:56:11
Showing 1 changed files
... ...
@@ -20,40 +20,93 @@
20 20
 
21 21
 #include "sctp_core.h"
22 22
 
23
-int sctp_core_msg_send(struct dest_info* dst, char* buf, unsigned len)
23
+/**
24
+ *
25
+ */
26
+static sctp_srapi_t _sctp_srapi = { 0 };
27
+static int _sctp_srapi_set = 0;
28
+
29
+/**
30
+ *
31
+ */
32
+int sctp_core_init(void)
24 33
 {
25
-	return 0;
34
+	if(_sctp_srapi_set==0) {
35
+		LM_ERR("SCTP API not initialized\n");
36
+		return -1;
37
+	}
38
+
39
+	return _sctp_srapi.init();
26 40
 }
27 41
 
42
+/**
43
+ *
44
+ */
28 45
 void sctp_core_destroy(void)
29 46
 {
30 47
 }
31 48
 
49
+/**
50
+ *
51
+ */
32 52
 int sctp_core_init_sock(struct socket_info* sock_info)
33 53
 {
34 54
 	return 0;
35 55
 }
36 56
 
37
-int sctp_core_rcv_loop(void)
57
+/**
58
+ *
59
+ */
60
+void sctp_core_init_options(void)
61
+{
62
+}
63
+
64
+/**
65
+ *
66
+ */
67
+int sctp_core_check_compiled_sockopts(char* buf, int size)
38 68
 {
39 69
 	return 0;
40 70
 }
41 71
 
42
-void sctp_core_init_options(void)
72
+/**
73
+ *
74
+ */
75
+int sctp_core_check_support(void)
43 76
 {
77
+	return 0;
44 78
 }
45 79
 
46
-int sctp_core_check_compiled_sockopts(char* buf, int size)
80
+/**
81
+ *
82
+ */
83
+int sctp_core_rcv_loop(void)
47 84
 {
48 85
 	return 0;
49 86
 }
50 87
 
51
-int sctp_core_check_support(void)
88
+/**
89
+ *
90
+ */
91
+int sctp_core_msg_send(struct dest_info* dst, char* buf, unsigned len)
52 92
 {
53 93
 	return 0;
54 94
 }
55 95
 
56
-int sctp_core_init(void)
96
+/**
97
+ *
98
+ */
99
+int sctp_core_register_api(sctp_srapi_t *api)
57 100
 {
101
+	if(api==NULL || api->init==NULL) {
102
+		LM_ERR("invalid parameters\n");
103
+		return -1;
104
+	}
105
+	if(_sctp_srapi_set==1) {
106
+		LM_ERR("SCTP API already initialized\n");
107
+		return -1;
108
+	}
109
+	_sctp_srapi_set = 1;
110
+	memcpy(&_sctp_srapi, api, sizeof(sctp_srapi_t));
58 111
 	return 0;
59 112
 }
Browse code

core: added file sctp core interface

Daniel-Constantin Mierla authored on 25/05/2013 07:35:22
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,59 @@
1
+/**
2
+ * $Id$
3
+ *
4
+ * Copyright (C) 2013 Daniel-Constantin Mierla (asipto.com)
5
+ *
6
+ * This file is part of Kamailio, a free SIP server.
7
+ *
8
+ * Permission to use, copy, modify, and distribute this software for any
9
+ * purpose with or without fee is hereby granted, provided that the above
10
+ * copyright notice and this permission notice appear in all copies.
11
+ *
12
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
15
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19
+ */
20
+
21
+#include "sctp_core.h"
22
+
23
+int sctp_core_msg_send(struct dest_info* dst, char* buf, unsigned len)
24
+{
25
+	return 0;
26
+}
27
+
28
+void sctp_core_destroy(void)
29
+{
30
+}
31
+
32
+int sctp_core_init_sock(struct socket_info* sock_info)
33
+{
34
+	return 0;
35
+}
36
+
37
+int sctp_core_rcv_loop(void)
38
+{
39
+	return 0;
40
+}
41
+
42
+void sctp_core_init_options(void)
43
+{
44
+}
45
+
46
+int sctp_core_check_compiled_sockopts(char* buf, int size)
47
+{
48
+	return 0;
49
+}
50
+
51
+int sctp_core_check_support(void)
52
+{
53
+	return 0;
54
+}
55
+
56
+int sctp_core_init(void)
57
+{
58
+	return 0;
59
+}