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,91 +0,0 @@
1
-/* 
2
- * Copyright (C) 2009 iptelorg GmbH
3
- *
4
- * Permission to use, copy, modify, and distribute this software for any
5
- * purpose with or without fee is hereby granted, provided that the above
6
- * copyright notice and this permission notice appear in all copies.
7
- *
8
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
- */
16
-/*!
17
- * \brief Kamailio core :: tcp_ev.h - tcp events
18
- * \ingroup core
19
- */
20
-
21
-#ifndef __tcp_ev_h
22
-#define __tcp_ev_h
23
-
24
-#include <errno.h>
25
-#include <string.h>
26
-
27
-#include "ip_addr.h"
28
-
29
-
30
-/** a connect attempt got a RST from the peer
31
- * Note: the RST might be for the connect() itself (SYN), for the first
32
- *  send() attempt on the connection (unlikely) or received immediately after
33
- * the connect() succeeded (unlikely, the remote host would have a very small
34
- *  window after accepting a connection to send a RST before it receives
35
- * any data).
36
- *
37
- * @param err - if 0 it should be ignored (no corresp. libc error), if non-0
38
- *                it will contain the errno.
39
- * @param lip   - pointer to an ip_addr containing the local ip
40
- *                   or 0 if dynamic (WARNING can be 0).
41
- * @param lport - pointer to an ip_addr containing the local port or 0
42
- *                   if unknown/dynamic.
43
- * @param dst   - pointer to a sockaddr_union containing the destination.
44
- * @param proto - protocol used
45
- */
46
-#define TCP_EV_CONNECT_RST(err, lip, lport, dst, proto) \
47
-	LM_ERR("connect %s failed (RST) %s\n", \
48
-			su2a(dst, sizeof(*(dst))), (err)?strerror(err):"")
49
-
50
-/** a connect failed because the remote host/network is unreachable. */
51
-#define TCP_EV_CONNECT_UNREACHABLE(err, lip, lport, dst, proto) \
52
-	LM_ERR("connect %s failed (unreachable) %s\n", \
53
-			su2a(dst, sizeof(*(dst))), (err)?strerror(err):"")
54
-
55
-/** a connect attempt did timeout. */
56
-#define TCP_EV_CONNECT_TIMEOUT(err, lip, lport, dst, proto) \
57
-	LM_ERR("connect %s failed (timeout) %s\n", \
58
-			su2a(dst, sizeof(*(dst))), (err)?strerror(err):"")
59
-
60
-/** a connect attempt failed because the local ports are exhausted. */
61
-#define TCP_EV_CONNECT_NO_MORE_PORTS(err, lip, lport, dst, proto) \
62
-	LM_ERR("connect %s failed (no more ports) %s\n", \
63
-			su2a(dst, sizeof(*(dst))), (err)?strerror(err):"")
64
-
65
-/** a connect attempt failed for some unknown reason.  */
66
-#define TCP_EV_CONNECT_ERR(err, lip, lport, dst, proto) \
67
-	LM_ERR("connect %s failed %s\n", \
68
-			su2a(dst, sizeof(*(dst))), (err)?strerror(err):"")
69
-
70
-
71
-/** send failed due to timeout.
72
- * @param err   - if 0 it should be ignored (no corresp. libc error), if non-0
73
- *                it will contain the errno.
74
- * @param rcv   - pointer to rcv_info structure
75
- * 
76
- */
77
-#define TCP_EV_SEND_TIMEOUT(err, rcv)
78
-
79
-/** send failed due to buffering capacity being exceeded.
80
-  * (only in async mode) */
81
-#define TCP_EV_SENDQ_FULL(err, rcv)
82
-
83
-/** established connection closed for being idle too long. */
84
-#define TCP_EV_IDLE_CONN_CLOSED(err, rcv)
85
-
86
-
87
-
88
-
89
-#endif /*__tcp_ev_h*/
90
-
91
-/* vi: set ts=4 sw=4 tw=79:ai:cindent: */
Browse code

core: Modify doxygen, remove history, remove SVN IDs, change "ser" and "sip-router" to "KAMAILIO"

Olle E. Johansson authored on 16/01/2015 16:38:46
Showing 1 changed files
... ...
@@ -1,6 +1,4 @@
1 1
 /* 
2
- * $Id$
3
- * 
4 2
  * Copyright (C) 2009 iptelorg GmbH
5 3
  *
6 4
  * Permission to use, copy, modify, and distribute this software for any
... ...
@@ -15,14 +13,10 @@
15 13
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 14
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 15
  */
18
-/*
19
- * tcp_ev.h - tcp events
16
+/*!
17
+ * \brief Kamailio core :: tcp_ev.h - tcp events
18
+ * \ingroup core
20 19
  */
21
-/*
22
- * History:
23
- * --------
24
- *  2009-04-09  initial version (andrei)
25
-*/
26 20
 
27 21
 #ifndef __tcp_ev_h
28 22
 #define __tcp_ev_h
Browse code

tcp_ev.h: logging: convert LOG to LM_*

Ovidiu Sas authored on 03/10/2014 19:15:19
Showing 1 changed files
... ...
@@ -50,27 +50,27 @@
50 50
  * @param proto - protocol used
51 51
  */
52 52
 #define TCP_EV_CONNECT_RST(err, lip, lport, dst, proto) \
53
-	LOG(L_ERR, "connect %s failed (RST) %s\n", \
53
+	LM_ERR("connect %s failed (RST) %s\n", \
54 54
 			su2a(dst, sizeof(*(dst))), (err)?strerror(err):"")
55 55
 
56 56
 /** a connect failed because the remote host/network is unreachable. */
57 57
 #define TCP_EV_CONNECT_UNREACHABLE(err, lip, lport, dst, proto) \
58
-	LOG(L_ERR, "connect %s failed (unreachable) %s\n", \
58
+	LM_ERR("connect %s failed (unreachable) %s\n", \
59 59
 			su2a(dst, sizeof(*(dst))), (err)?strerror(err):"")
60 60
 
61 61
 /** a connect attempt did timeout. */
62 62
 #define TCP_EV_CONNECT_TIMEOUT(err, lip, lport, dst, proto) \
63
-	LOG(L_ERR, "connect %s failed (timeout) %s\n", \
63
+	LM_ERR("connect %s failed (timeout) %s\n", \
64 64
 			su2a(dst, sizeof(*(dst))), (err)?strerror(err):"")
65 65
 
66 66
 /** a connect attempt failed because the local ports are exhausted. */
67 67
 #define TCP_EV_CONNECT_NO_MORE_PORTS(err, lip, lport, dst, proto) \
68
-	LOG(L_ERR, "connect %s failed (no more ports) %s\n", \
68
+	LM_ERR("connect %s failed (no more ports) %s\n", \
69 69
 			su2a(dst, sizeof(*(dst))), (err)?strerror(err):"")
70 70
 
71 71
 /** a connect attempt failed for some unknown reason.  */
72 72
 #define TCP_EV_CONNECT_ERR(err, lip, lport, dst, proto) \
73
-	LOG(L_ERR, "connect %s failed %s\n", \
73
+	LM_ERR("connect %s failed %s\n", \
74 74
 			su2a(dst, sizeof(*(dst))), (err)?strerror(err):"")
75 75
 
76 76
 
Browse code

tcp: internal macro-hooks for stats & events

- added macros for tcp statistics (for now empty, keeping
more statistics will only involve redefining them):

TCP_STATS_ESTABLISHED(state) - new connection established
TCP_STATS_CONNECT_FAILED() - new outgoing connection failed
TCP_STATS_LOCAL_REJECT() - new incoming connection rejected
(max. no exceeded)
TCP_STATS_CON_TIMEOUT() - connection closed for being idle too
long
TCP_STATS_SEND_TIMEOUT() - send fails due to a timeout
TCP_STATS_SENDQ_FULL() - send fails because of the buffering
capacity being exceed (async mode
only)

- added macros for various tcp events (for now some of them are
used for logging):

TCP_EV_CONNECT_RST(...) - connect attempt received RST
TCP_EV_CONNECT_UNREACHABLE(...)
TCP_EV_CONNECT_TIMEOUT(...)
TCP_EV_CONNECT_NO_MORE_PORTS(...)
TCP_EV_CONNECT_ERR(...) - other connect error
TCP_EV_SEND_TIMEOUT(...)
TCP_EV_SENDQ_FULL(...)
TCP_EV_IDLE_CONN_CLOSED(...)

Andrei Pelinescu-Onciul authored on 09/04/2009 19:10:56
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,97 @@
1
+/* 
2
+ * $Id$
3
+ * 
4
+ * Copyright (C) 2009 iptelorg GmbH
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
+ * tcp_ev.h - tcp events
20
+ */
21
+/*
22
+ * History:
23
+ * --------
24
+ *  2009-04-09  initial version (andrei)
25
+*/
26
+
27
+#ifndef __tcp_ev_h
28
+#define __tcp_ev_h
29
+
30
+#include <errno.h>
31
+#include <string.h>
32
+
33
+#include "ip_addr.h"
34
+
35
+
36
+/** a connect attempt got a RST from the peer
37
+ * Note: the RST might be for the connect() itself (SYN), for the first
38
+ *  send() attempt on the connection (unlikely) or received immediately after
39
+ * the connect() succeeded (unlikely, the remote host would have a very small
40
+ *  window after accepting a connection to send a RST before it receives
41
+ * any data).
42
+ *
43
+ * @param err - if 0 it should be ignored (no corresp. libc error), if non-0
44
+ *                it will contain the errno.
45
+ * @param lip   - pointer to an ip_addr containing the local ip
46
+ *                   or 0 if dynamic (WARNING can be 0).
47
+ * @param lport - pointer to an ip_addr containing the local port or 0
48
+ *                   if unknown/dynamic.
49
+ * @param dst   - pointer to a sockaddr_union containing the destination.
50
+ * @param proto - protocol used
51
+ */
52
+#define TCP_EV_CONNECT_RST(err, lip, lport, dst, proto) \
53
+	LOG(L_ERR, "connect %s failed (RST) %s\n", \
54
+			su2a(dst, sizeof(*(dst))), (err)?strerror(err):"")
55
+
56
+/** a connect failed because the remote host/network is unreachable. */
57
+#define TCP_EV_CONNECT_UNREACHABLE(err, lip, lport, dst, proto) \
58
+	LOG(L_ERR, "connect %s failed (unreachable) %s\n", \
59
+			su2a(dst, sizeof(*(dst))), (err)?strerror(err):"")
60
+
61
+/** a connect attempt did timeout. */
62
+#define TCP_EV_CONNECT_TIMEOUT(err, lip, lport, dst, proto) \
63
+	LOG(L_ERR, "connect %s failed (timeout) %s\n", \
64
+			su2a(dst, sizeof(*(dst))), (err)?strerror(err):"")
65
+
66
+/** a connect attempt failed because the local ports are exhausted. */
67
+#define TCP_EV_CONNECT_NO_MORE_PORTS(err, lip, lport, dst, proto) \
68
+	LOG(L_ERR, "connect %s failed (no more ports) %s\n", \
69
+			su2a(dst, sizeof(*(dst))), (err)?strerror(err):"")
70
+
71
+/** a connect attempt failed for some unknown reason.  */
72
+#define TCP_EV_CONNECT_ERR(err, lip, lport, dst, proto) \
73
+	LOG(L_ERR, "connect %s failed %s\n", \
74
+			su2a(dst, sizeof(*(dst))), (err)?strerror(err):"")
75
+
76
+
77
+/** send failed due to timeout.
78
+ * @param err   - if 0 it should be ignored (no corresp. libc error), if non-0
79
+ *                it will contain the errno.
80
+ * @param rcv   - pointer to rcv_info structure
81
+ * 
82
+ */
83
+#define TCP_EV_SEND_TIMEOUT(err, rcv)
84
+
85
+/** send failed due to buffering capacity being exceeded.
86
+  * (only in async mode) */
87
+#define TCP_EV_SENDQ_FULL(err, rcv)
88
+
89
+/** established connection closed for being idle too long. */
90
+#define TCP_EV_IDLE_CONN_CLOSED(err, rcv)
91
+
92
+
93
+
94
+
95
+#endif /*__tcp_ev_h*/
96
+
97
+/* vi: set ts=4 sw=4 tw=79:ai:cindent: */