- 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)
1 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,52 +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 :: raw socket functions. |
|
18 |
- * @file raw_sock.c |
|
19 |
- * @ingroup core |
|
20 |
- * @author andrei |
|
21 |
- * Module: @ref core |
|
22 |
- */ |
|
23 |
- |
|
24 |
-#ifndef _raw_sock_h |
|
25 |
-#define _raw_sock_h |
|
26 |
- |
|
27 |
-#include "ip_addr.h" |
|
28 |
- |
|
29 |
-/** filter for limiting packets received on raw sockets. */ |
|
30 |
-struct raw_filter{ |
|
31 |
- struct net dst; |
|
32 |
- unsigned short port1; |
|
33 |
- unsigned short port2; |
|
34 |
- char proto; |
|
35 |
-}; |
|
36 |
- |
|
37 |
-extern int raw_ipip; |
|
38 |
- |
|
39 |
-int raw_socket(int proto, struct ip_addr* ip, str* iface, int iphdr_incl); |
|
40 |
-int raw_udp4_socket(struct ip_addr* ip, str* iface, int iphdr_incl); |
|
41 |
-int recvpkt4(int sock, char* buf, int len, union sockaddr_union* from, |
|
42 |
- union sockaddr_union* to); |
|
43 |
-int raw_udp4_recv(int rsock, char** buf, int len, union sockaddr_union* from, |
|
44 |
- union sockaddr_union* to, struct raw_filter* rf); |
|
45 |
-int raw_udp4_send(int rsock, char* buf, unsigned int len, |
|
46 |
- union sockaddr_union* from, |
|
47 |
- union sockaddr_union* to); |
|
48 |
-int raw_iphdr_udp4_send(int rsock, char* buf, unsigned int len, |
|
49 |
- union sockaddr_union* from, |
|
50 |
- union sockaddr_union* to, unsigned short mtu); |
|
51 |
- |
|
52 |
-#endif /* _raw_sock_h */ |
... | ... |
@@ -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,16 +13,13 @@ |
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 |
-/** raw socket functions. |
|
16 |
+ |
|
17 |
+/** Kamailio core :: raw socket functions. |
|
19 | 18 |
* @file raw_sock.c |
20 | 19 |
* @ingroup core |
20 |
+ * @author andrei |
|
21 | 21 |
* Module: @ref core |
22 | 22 |
*/ |
23 |
-/* |
|
24 |
- * History: |
|
25 |
- * -------- |
|
26 |
- * 2010-06-07 initial version (from older code) andrei |
|
27 |
- */ |
|
28 | 23 |
|
29 | 24 |
#ifndef _raw_sock_h |
30 | 25 |
#define _raw_sock_h |
Support for sending on raw sockets with IP_HDRINCL or IPPROTO_RAW,
that require building the IP header and fragmentation.
... | ... |
@@ -46,7 +46,11 @@ int recvpkt4(int sock, char* buf, int len, union sockaddr_union* from, |
46 | 46 |
union sockaddr_union* to); |
47 | 47 |
int raw_udp4_recv(int rsock, char** buf, int len, union sockaddr_union* from, |
48 | 48 |
union sockaddr_union* to, struct raw_filter* rf); |
49 |
-int raw_udp4_send(int rsock, char* buf, int len, union sockaddr_union* from, |
|
49 |
+int raw_udp4_send(int rsock, char* buf, unsigned int len, |
|
50 |
+ union sockaddr_union* from, |
|
50 | 51 |
union sockaddr_union* to); |
52 |
+int raw_iphdr_udp4_send(int rsock, char* buf, unsigned int len, |
|
53 |
+ union sockaddr_union* from, |
|
54 |
+ union sockaddr_union* to, unsigned short mtu); |
|
51 | 55 |
|
52 | 56 |
#endif /* _raw_sock_h */ |
Basic support for raw sockets. Functions for creating, sending and
receiving udp packets over raw sockets.
Initial version supports only linux.
1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,52 @@ |
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 |
+/** raw socket functions. |
|
19 |
+ * @file raw_sock.c |
|
20 |
+ * @ingroup core |
|
21 |
+ * Module: @ref core |
|
22 |
+ */ |
|
23 |
+/* |
|
24 |
+ * History: |
|
25 |
+ * -------- |
|
26 |
+ * 2010-06-07 initial version (from older code) andrei |
|
27 |
+ */ |
|
28 |
+ |
|
29 |
+#ifndef _raw_sock_h |
|
30 |
+#define _raw_sock_h |
|
31 |
+ |
|
32 |
+#include "ip_addr.h" |
|
33 |
+ |
|
34 |
+/** filter for limiting packets received on raw sockets. */ |
|
35 |
+struct raw_filter{ |
|
36 |
+ struct net dst; |
|
37 |
+ unsigned short port1; |
|
38 |
+ unsigned short port2; |
|
39 |
+ char proto; |
|
40 |
+}; |
|
41 |
+ |
|
42 |
+ |
|
43 |
+int raw_socket(int proto, struct ip_addr* ip, str* iface, int iphdr_incl); |
|
44 |
+int raw_udp4_socket(struct ip_addr* ip, str* iface, int iphdr_incl); |
|
45 |
+int recvpkt4(int sock, char* buf, int len, union sockaddr_union* from, |
|
46 |
+ union sockaddr_union* to); |
|
47 |
+int raw_udp4_recv(int rsock, char** buf, int len, union sockaddr_union* from, |
|
48 |
+ union sockaddr_union* to, struct raw_filter* rf); |
|
49 |
+int raw_udp4_send(int rsock, char* buf, int len, union sockaddr_union* from, |
|
50 |
+ union sockaddr_union* to); |
|
51 |
+ |
|
52 |
+#endif /* _raw_sock_h */ |