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,65 +0,0 @@
1
-/* 
2
- * Copyright (C) 2010 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
-/** Kamailio core :: various socket related functions.
18
- * @file sock_ut.c
19
- * @ingroup: core 
20
- */
21
-
22
-#include "sock_ut.h"
23
-
24
-#include <sys/types.h>
25
-#include <sys/socket.h>
26
-#include <netinet/in.h>
27
-#include <netinet/in_systm.h>
28
-#include <netinet/ip.h>
29
-#include <errno.h>
30
-#include <arpa/inet.h>
31
-
32
-
33
-/** get the IP TTL.
34
- * @return ttl on success, < 0 on error
35
- */
36
-int sock_get_ttl(int sock)
37
-{
38
-	int ioptval = 0;
39
-	unsigned int ioptvallen = 0;
40
-
41
-	ioptvallen=sizeof(ioptval);
42
-	if (getsockopt( sock, IPPROTO_IP, IP_TTL, (void*) &ioptval,
43
-		    &ioptvallen) == -1 )
44
-	{
45
-		return -1;
46
-	}
47
-	return ioptval;
48
-}
49
-
50
-
51
-
52
-/** set the IP TTL on a socket.
53
- * @return ttl on success, < 0 on error
54
- */
55
-int sock_set_ttl(int sock, int ttl)
56
-{
57
-	int ioptval = 0;
58
-
59
-	if (setsockopt( sock, IPPROTO_IP, IP_TTL, (void*) &ioptval,
60
-					sizeof(ioptval)) == -1 )
61
-		return -1;
62
-	return ioptval;
63
-}
64
-
65
-/* vi: set ts=4 sw=4 tw=79:ai:cindent: */
Browse code

core: init vars for socket ttl helper function to avoid warnings

Daniel-Constantin Mierla authored on 14/05/2015 08:25:47
Showing 1 changed files
... ...
@@ -35,8 +35,8 @@
35 35
  */
36 36
 int sock_get_ttl(int sock)
37 37
 {
38
-	int ioptval;
39
-	unsigned int ioptvallen;
38
+	int ioptval = 0;
39
+	unsigned int ioptvallen = 0;
40 40
 
41 41
 	ioptvallen=sizeof(ioptval);
42 42
 	if (getsockopt( sock, IPPROTO_IP, IP_TTL, (void*) &ioptval,
... ...
@@ -54,7 +54,7 @@ int sock_get_ttl(int sock)
54 54
  */
55 55
 int sock_set_ttl(int sock, int ttl)
56 56
 {
57
-	int ioptval;
57
+	int ioptval = 0;
58 58
 
59 59
 	if (setsockopt( sock, IPPROTO_IP, IP_TTL, (void*) &ioptval,
60 60
 					sizeof(ioptval)) == -1 )
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 1
 /* 
2
- * $Id$
3
- * 
4 2
  * Copyright (C) 2010 iptelorg GmbH
5 3
  *
6 4
  * Permission to use, copy, modify, and distribute this software for any
... ...
@@ -15,15 +13,11 @@
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
-/** various socket related functions.
16
+
17
+/** Kamailio core :: various socket related functions.
19 18
  * @file sock_ut.c
20 19
  * @ingroup: core 
21 20
  */
22
-/*
23
- * History:
24
- * --------
25
- *  2010-08-09  initial version (andrei)
26
-*/
27 21
 
28 22
 #include "sock_ut.h"
29 23
 
Browse code

raw sockets: ttl can be set or auto-detected

The IP TTL used when sending on raw sockets can be set using the
core.udp4_raw_ttl config variable.
By default it is auto-detected on startup (the same IP TTL as the
one for the first udp4 socket is used).

Andrei Pelinescu-Onciul authored on 10/08/2010 09:09:19
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,71 @@
1
+/* 
2
+ * $Id$
3
+ * 
4
+ * Copyright (C) 2010 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
+/** various socket related functions.
19
+ * @file sock_ut.c
20
+ * @ingroup: core 
21
+ */
22
+/*
23
+ * History:
24
+ * --------
25
+ *  2010-08-09  initial version (andrei)
26
+*/
27
+
28
+#include "sock_ut.h"
29
+
30
+#include <sys/types.h>
31
+#include <sys/socket.h>
32
+#include <netinet/in.h>
33
+#include <netinet/in_systm.h>
34
+#include <netinet/ip.h>
35
+#include <errno.h>
36
+#include <arpa/inet.h>
37
+
38
+
39
+/** get the IP TTL.
40
+ * @return ttl on success, < 0 on error
41
+ */
42
+int sock_get_ttl(int sock)
43
+{
44
+	int ioptval;
45
+	unsigned int ioptvallen;
46
+
47
+	ioptvallen=sizeof(ioptval);
48
+	if (getsockopt( sock, IPPROTO_IP, IP_TTL, (void*) &ioptval,
49
+		    &ioptvallen) == -1 )
50
+	{
51
+		return -1;
52
+	}
53
+	return ioptval;
54
+}
55
+
56
+
57
+
58
+/** set the IP TTL on a socket.
59
+ * @return ttl on success, < 0 on error
60
+ */
61
+int sock_set_ttl(int sock, int ttl)
62
+{
63
+	int ioptval;
64
+
65
+	if (setsockopt( sock, IPPROTO_IP, IP_TTL, (void*) &ioptval,
66
+					sizeof(ioptval)) == -1 )
67
+		return -1;
68
+	return ioptval;
69
+}
70
+
71
+/* vi: set ts=4 sw=4 tw=79:ai:cindent: */