Browse code

core, lib, modules: updated include paths for header files

Daniel-Constantin Mierla authored on 07/12/2016 11:07:22
Showing 1 changed files
... ...
@@ -22,7 +22,7 @@
22 22
 #define _init_socks_h
23 23
 #include <sys/types.h>
24 24
 #include <sys/un.h>
25
-#include "../../ip_addr.h"
25
+#include "../../core/ip_addr.h"
26 26
 
27 27
 enum socket_protos	{	UNKNOWN_SOCK=0, UDP_SOCK, TCP_SOCK, 
28 28
 						UNIXS_SOCK, UNIXD_SOCK
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
new file mode 100644
... ...
@@ -0,0 +1,60 @@
1
+/*
2
+ * Copyright (C) 2006 iptelorg GmbH
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
+#ifndef _init_socks_h
22
+#define _init_socks_h
23
+#include <sys/types.h>
24
+#include <sys/un.h>
25
+#include "../../ip_addr.h"
26
+
27
+enum socket_protos	{	UNKNOWN_SOCK=0, UDP_SOCK, TCP_SOCK, 
28
+						UNIXS_SOCK, UNIXD_SOCK
29
+#ifdef USE_FIFO
30
+							, FIFO_SOCK
31
+#endif
32
+};
33
+
34
+int init_unix_sock(struct sockaddr_un* su, char* name, int type,
35
+					int perm, int uid, int gid);
36
+int init_tcpudp_sock(union sockaddr_union* su, char* address, int port,
37
+					enum socket_protos type);
38
+int init_sock_opt(int s, enum socket_protos type);
39
+
40
+inline static char* socket_proto_name(enum socket_protos p)
41
+{
42
+	switch(p){
43
+		case UDP_SOCK:
44
+			return "udp";
45
+		case TCP_SOCK:
46
+			return "tcp";
47
+		case UNIXS_SOCK:
48
+			return "unix_stream";
49
+		case UNIXD_SOCK:
50
+			return "unix_dgram";
51
+#ifdef USE_FIFO
52
+		case FIFO_SOCK:
53
+			return "fifo";
54
+#endif
55
+		default:
56
+			;
57
+	}
58
+	return "<unknown>";
59
+}
60
+#endif