Browse code

modules_k/*: moved k modules in directory modules/

Daniel-Constantin Mierla authored on 20/01/2013 11:57:52
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,178 +0,0 @@
1
-/* $Id$
2
- *
3
- * Copyright (C) 2006-2007 VozTelecom Sistemas S.L
4
- *
5
- * This file is part of Kamailio, a free SIP server.
6
- *
7
- * Kamailio is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License as published by
9
- * the Free Software Foundation; either version 2 of the License, or
10
- * (at your option) any later version
11
- *
12
- * Kamailio is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
- * GNU General Public License for more details.
16
- *
17
- * You should have received a copy of the GNU General Public License 
18
- * along with this program; if not, write to the Free Software 
19
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20
- */
21
-
22
-#ifndef _SEAS_H
23
-#define _SEAS_H
24
-#include <arpa/inet.h>
25
-
26
-#include "../../str.h"/*str*/
27
-#include "../../ip_addr.h"/*ip_addr*/
28
-#include "../../sr_module.h" /*version,etc*/
29
-#include "../../modules/tm/tm_load.h"/*tm_binds*/
30
-#include "ha.h"
31
-#include "cluster.h"
32
-#define MAX_AS_NR 5
33
-#define MAX_UNC_AS_NR 5
34
-#define MAX_AS_NAME 15
35
-/*#define AF2PF(af)   (((af)==AF_INET)?PF_INET:((af)==AF_INET6)?PF_INET6:(af))*/
36
-#define MAX_AS_PER_CLUSTER 10
37
-
38
-#define HAS_FD 1
39
-#define HAS_NAME 2
40
-
41
-#define MAX_BINDS 10
42
-#define MAX_WHOAMI_LEN 30
43
-
44
-#define AS_BUF_SIZE 4000
45
-
46
-#define ENCODED_MSG_SIZE 3200
47
-
48
-/** EVENT FLAGS */
49
-
50
-#define E2E_ACK 0x04
51
-#define CANCEL_FOUND 0x08
52
-
53
-#define AS_TYPE 1
54
-#define CLUSTER_TYPE 2
55
-
56
-/** ACTION identifiers **/
57
-
58
-#define T_REQ_IN 2
59
-#define SL_REQ_IN 3
60
-#define RES_IN 4
61
-#define PING_AC 5
62
-#define BIND_AC 6
63
-#define UNBIND_AC 7
64
-
65
-/** ACTION identifiers **/
66
-
67
-#define SPIRAL_FLAG 0x00000001
68
-
69
-#define net2hostL(dst,from,index) do{ \
70
-   memcpy(&(dst),(from)+(index),4); \
71
-   dst=ntohl(dst); \
72
-   (index)+=4; \
73
-}while(0);
74
-
75
-
76
-
77
-extern char use_stats;
78
-extern char whoami[];
79
-extern int is_dispatcher;
80
-
81
-extern struct ip_addr *seas_listen_ip;
82
-extern unsigned short seas_listen_port;
83
-
84
-extern int write_pipe;
85
-extern int read_pipe;
86
-extern char seas_sigchld_received;
87
-
88
-extern int jain_ping;
89
-extern int jain_pings_lost;
90
-
91
-extern int servlet_ping;
92
-extern int servlet_pings_lost;
93
-
94
-extern struct as_entry *as_table;
95
-
96
-struct seas_functions{
97
-   struct tm_binds tmb;
98
-   cmd_function t_check_orig_trans;
99
-};
100
-
101
-/*TODO listen_points should be dynamically allocated ?*/
102
-typedef struct app_server {
103
-   int event_fd;
104
-   int action_fd;
105
-   str name;
106
-   pid_t action_pid;
107
-   struct socket_info *binds[MAX_BINDS];
108
-   char bound_processor[MAX_BINDS];
109
-   int num_binds;
110
-   str ev_buffer;
111
-   str ac_buffer;
112
-   struct ha jain_pings;
113
-   struct ha servlet_pings;
114
-   struct cluster *cluster;
115
-}as_t, *as_p;
116
-
117
-struct cluster{
118
-   str name;
119
-   int num;
120
-   int registered;
121
-   str as_names[MAX_AS_PER_CLUSTER];
122
-   as_p servers[MAX_AS_PER_CLUSTER];
123
-};
124
-
125
-/**
126
- * SER processes will go through the as_table, doing if(valid && memcmp(name,his_name,name_len)==0),
127
- * when one matches, they will put the as pointer inside the event that should process
128
- * that event.
129
- * If eventually the as becomes unavailable, the dispatcher will set valid=false, which should be
130
- * atomic operation. This way, we prevent having to put a mutex on the array, which would make 
131
- * it slower , as only one process could be accessing it at a time.
132
- */
133
-struct as_entry{
134
-   str name;
135
-   int type;
136
-   int connected;
137
-   union{
138
-      struct app_server as;
139
-      struct cluster cs;
140
-   }u;
141
-   struct as_entry *next;
142
-};
143
-
144
-
145
-extern struct as_entry *my_as;
146
-extern struct seas_functions seas_f; 
147
-extern struct as_entry *as_list;
148
-
149
-typedef struct as_msg {
150
-   struct cell *transaction;
151
-   char *msg;
152
-   int len;
153
-   int type;
154
-   int id;
155
-   struct as_entry *as;
156
-}as_msg_t,*as_msg_p;
157
-
158
-char get_processor_id(struct receive_info *rcv,as_p as);
159
-void seas_sighandler(int signo);
160
-char* create_as_event_t(struct cell *t,struct sip_msg *msg,char processor_id,int *evt_len,int flags);
161
-char* create_as_event_sl(struct sip_msg *msg,char processor_id,int *evt_len,int flags);
162
-
163
-static inline void print_ip_buf(struct ip_addr* ip, char *where,int len)
164
-{
165
-   switch(ip->af){
166
-      case AF_INET:
167
-	 snprintf(where,len,"%d.%d.%d.%d", ip->u.addr[0], ip->u.addr[1], ip->u.addr[2], ip->u.addr[3]);
168
-	 break;
169
-      case AF_INET6:
170
-	 snprintf(where,len,"%x:%x:%x:%x:%x:%x:%x:%x",htons(ip->u.addr16[0]),htons(ip->u.addr16[1]),htons(ip->u.addr16[2]),
171
-	       htons(ip->u.addr16[3]), htons(ip->u.addr16[4]), htons(ip->u.addr16[5]), htons(ip->u.addr16[6]),
172
-	       htons(ip->u.addr16[7]));
173
-	 break;
174
-      default:
175
-	 break;
176
-   }
177
-}
178
-#endif
Browse code

Fix relative paths to tm header files.

This patch fixes relative paths to header files included from the tm
module. The module is located in sip-router/modules which kamailio
modules are in sip-router/modules_k, thus we have to replace ../tm/
with ../../modules/tm/.

Jan Janak authored on 15/04/2009 15:09:42
Showing 1 changed files
... ...
@@ -26,7 +26,7 @@
26 26
 #include "../../str.h"/*str*/
27 27
 #include "../../ip_addr.h"/*ip_addr*/
28 28
 #include "../../sr_module.h" /*version,etc*/
29
-#include "../tm/tm_load.h"/*tm_binds*/
29
+#include "../../modules/tm/tm_load.h"/*tm_binds*/
30 30
 #include "ha.h"
31 31
 #include "cluster.h"
32 32
 #define MAX_AS_NR 5
Browse code

- change name in copyright headers

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@4518 689a6050-402a-0410-94f2-e92a70836424

Henning Westerholt authored on 28/07/2008 15:39:28
Showing 1 changed files
... ...
@@ -2,14 +2,14 @@
2 2
  *
3 3
  * Copyright (C) 2006-2007 VozTelecom Sistemas S.L
4 4
  *
5
- * This file is part of openser, a free SIP server.
5
+ * This file is part of Kamailio, a free SIP server.
6 6
  *
7
- * openser is free software; you can redistribute it and/or modify
7
+ * Kamailio is free software; you can redistribute it and/or modify
8 8
  * it under the terms of the GNU General Public License as published by
9 9
  * the Free Software Foundation; either version 2 of the License, or
10 10
  * (at your option) any later version
11 11
  *
12
- * openser is distributed in the hope that it will be useful,
12
+ * Kamailio is distributed in the hope that it will be useful,
13 13
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 14
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 15
  * GNU General Public License for more details.
Browse code

- removed some old commented out usages of LOG() - fixed code ambiguity ( added some brakets)

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@3318 689a6050-402a-0410-94f2-e92a70836424

Bogdan-Andrei Iancu authored on 12/12/2007 10:17:44
Showing 1 changed files
... ...
@@ -72,8 +72,6 @@
72 72
    (index)+=4; \
73 73
 }while(0);
74 74
 
75
-/*#define LOG(leve,format, ...) LOG(leve,__VA_ARGS__)
76
-LOG(leve,"seas-%s:%s:"format,leve==4?"DBG":leve==3?"INF":leve==2?"NTC":leve==1?"WRN":leve==-1?"ERR":leve==-2?"CRT":leve==-3?"ALT":"UNK",__FUNCTION__,##__VA_ARGS__)*/
77 75
 
78 76
 
79 77
 extern char use_stats;
Browse code

- added license and copyright

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@1819 689a6050-402a-0410-94f2-e92a70836424

Daniel-Constantin Mierla authored on 11/03/2007 19:20:59
Showing 1 changed files
... ...
@@ -1,4 +1,24 @@
1
-/* $Id$ */
1
+/* $Id$
2
+ *
3
+ * Copyright (C) 2006-2007 VozTelecom Sistemas S.L
4
+ *
5
+ * This file is part of openser, a free SIP server.
6
+ *
7
+ * openser is free software; you can redistribute it and/or modify
8
+ * it under the terms of the GNU General Public License as published by
9
+ * the Free Software Foundation; either version 2 of the License, or
10
+ * (at your option) any later version
11
+ *
12
+ * openser is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
+ * GNU General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU General Public License 
18
+ * along with this program; if not, write to the Free Software 
19
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20
+ */
21
+
2 22
 #ifndef _SEAS_H
3 23
 #define _SEAS_H
4 24
 #include <arpa/inet.h>
Browse code

reverted to old logging system. fixed a couple of warnings regarding printf("%d",(int)sizeof(something))

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@1767 689a6050-402a-0410-94f2-e92a70836424

Elias Baixas authored on 08/03/2007 11:08:03
Showing 1 changed files
... ...
@@ -52,7 +52,8 @@
52 52
    (index)+=4; \
53 53
 }while(0);
54 54
 
55
-#define SLOG(leve,format, ...) LOG(leve,"seas-%s:%s:"format,leve==4?"DBG":leve==3?"INF":leve==2?"NTC":leve==1?"WRN":leve==-1?"ERR":leve==-2?"CRT":leve==-3?"ALT":"UNK",__FUNCTION__,##__VA_ARGS__)
55
+/*#define LOG(leve,format, ...) LOG(leve,__VA_ARGS__)
56
+LOG(leve,"seas-%s:%s:"format,leve==4?"DBG":leve==3?"INF":leve==2?"NTC":leve==1?"WRN":leve==-1?"ERR":leve==-2?"CRT":leve==-3?"ALT":"UNK",__FUNCTION__,##__VA_ARGS__)*/
56 57
 
57 58
 
58 59
 extern char use_stats;
Browse code

Changed the logging system

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@1725 689a6050-402a-0410-94f2-e92a70836424

Elias Baixas authored on 01/03/2007 17:25:55
Showing 1 changed files
... ...
@@ -46,14 +46,14 @@
46 46
 
47 47
 #define SPIRAL_FLAG 0x00000001
48 48
 
49
-#define LOG_OUT_OF_MEM(what) LOG(L_ERR,"ERROR:seas:global_init: out of mem for "what" \n");
50
-
51 49
 #define net2hostL(dst,from,index) do{ \
52 50
    memcpy(&(dst),(from)+(index),4); \
53 51
    dst=ntohl(dst); \
54 52
    (index)+=4; \
55 53
 }while(0);
56 54
 
55
+#define SLOG(leve,format, ...) LOG(leve,"seas-%s:%s:"format,leve==4?"DBG":leve==3?"INF":leve==2?"NTC":leve==1?"WRN":leve==-1?"ERR":leve==-2?"CRT":leve==-3?"ALT":"UNK",__FUNCTION__,##__VA_ARGS__)
56
+
57 57
 
58 58
 extern char use_stats;
59 59
 extern char whoami[];
Browse code

Added code files for SEAS module

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@1448 689a6050-402a-0410-94f2-e92a70836424

Elias Baixas authored on 22/12/2006 17:07:44
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,159 @@
1
+/* $Id$ */
2
+#ifndef _SEAS_H
3
+#define _SEAS_H
4
+#include <arpa/inet.h>
5
+
6
+#include "../../str.h"/*str*/
7
+#include "../../ip_addr.h"/*ip_addr*/
8
+#include "../../sr_module.h" /*version,etc*/
9
+#include "../tm/tm_load.h"/*tm_binds*/
10
+#include "ha.h"
11
+#include "cluster.h"
12
+#define MAX_AS_NR 5
13
+#define MAX_UNC_AS_NR 5
14
+#define MAX_AS_NAME 15
15
+/*#define AF2PF(af)   (((af)==AF_INET)?PF_INET:((af)==AF_INET6)?PF_INET6:(af))*/
16
+#define MAX_AS_PER_CLUSTER 10
17
+
18
+#define HAS_FD 1
19
+#define HAS_NAME 2
20
+
21
+#define MAX_BINDS 10
22
+#define MAX_WHOAMI_LEN 30
23
+
24
+#define AS_BUF_SIZE 4000
25
+
26
+#define ENCODED_MSG_SIZE 3200
27
+
28
+/** EVENT FLAGS */
29
+
30
+#define E2E_ACK 0x04
31
+#define CANCEL_FOUND 0x08
32
+
33
+#define AS_TYPE 1
34
+#define CLUSTER_TYPE 2
35
+
36
+/** ACTION identifiers **/
37
+
38
+#define T_REQ_IN 2
39
+#define SL_REQ_IN 3
40
+#define RES_IN 4
41
+#define PING_AC 5
42
+#define BIND_AC 6
43
+#define UNBIND_AC 7
44
+
45
+/** ACTION identifiers **/
46
+
47
+#define SPIRAL_FLAG 0x00000001
48
+
49
+#define LOG_OUT_OF_MEM(what) LOG(L_ERR,"ERROR:seas:global_init: out of mem for "what" \n");
50
+
51
+#define net2hostL(dst,from,index) do{ \
52
+   memcpy(&(dst),(from)+(index),4); \
53
+   dst=ntohl(dst); \
54
+   (index)+=4; \
55
+}while(0);
56
+
57
+
58
+extern char use_stats;
59
+extern char whoami[];
60
+extern int is_dispatcher;
61
+
62
+extern struct ip_addr *seas_listen_ip;
63
+extern unsigned short seas_listen_port;
64
+
65
+extern int write_pipe;
66
+extern int read_pipe;
67
+extern char seas_sigchld_received;
68
+
69
+extern int jain_ping;
70
+extern int jain_pings_lost;
71
+
72
+extern int servlet_ping;
73
+extern int servlet_pings_lost;
74
+
75
+extern struct as_entry *as_table;
76
+
77
+struct seas_functions{
78
+   struct tm_binds tmb;
79
+   cmd_function t_check_orig_trans;
80
+};
81
+
82
+/*TODO listen_points should be dynamically allocated ?*/
83
+typedef struct app_server {
84
+   int event_fd;
85
+   int action_fd;
86
+   str name;
87
+   pid_t action_pid;
88
+   struct socket_info *binds[MAX_BINDS];
89
+   char bound_processor[MAX_BINDS];
90
+   int num_binds;
91
+   str ev_buffer;
92
+   str ac_buffer;
93
+   struct ha jain_pings;
94
+   struct ha servlet_pings;
95
+   struct cluster *cluster;
96
+}as_t, *as_p;
97
+
98
+struct cluster{
99
+   str name;
100
+   int num;
101
+   int registered;
102
+   str as_names[MAX_AS_PER_CLUSTER];
103
+   as_p servers[MAX_AS_PER_CLUSTER];
104
+};
105
+
106
+/**
107
+ * SER processes will go through the as_table, doing if(valid && memcmp(name,his_name,name_len)==0),
108
+ * when one matches, they will put the as pointer inside the event that should process
109
+ * that event.
110
+ * If eventually the as becomes unavailable, the dispatcher will set valid=false, which should be
111
+ * atomic operation. This way, we prevent having to put a mutex on the array, which would make 
112
+ * it slower , as only one process could be accessing it at a time.
113
+ */
114
+struct as_entry{
115
+   str name;
116
+   int type;
117
+   int connected;
118
+   union{
119
+      struct app_server as;
120
+      struct cluster cs;
121
+   }u;
122
+   struct as_entry *next;
123
+};
124
+
125
+
126
+extern struct as_entry *my_as;
127
+extern struct seas_functions seas_f; 
128
+extern struct as_entry *as_list;
129
+
130
+typedef struct as_msg {
131
+   struct cell *transaction;
132
+   char *msg;
133
+   int len;
134
+   int type;
135
+   int id;
136
+   struct as_entry *as;
137
+}as_msg_t,*as_msg_p;
138
+
139
+char get_processor_id(struct receive_info *rcv,as_p as);
140
+void seas_sighandler(int signo);
141
+char* create_as_event_t(struct cell *t,struct sip_msg *msg,char processor_id,int *evt_len,int flags);
142
+char* create_as_event_sl(struct sip_msg *msg,char processor_id,int *evt_len,int flags);
143
+
144
+static inline void print_ip_buf(struct ip_addr* ip, char *where,int len)
145
+{
146
+   switch(ip->af){
147
+      case AF_INET:
148
+	 snprintf(where,len,"%d.%d.%d.%d", ip->u.addr[0], ip->u.addr[1], ip->u.addr[2], ip->u.addr[3]);
149
+	 break;
150
+      case AF_INET6:
151
+	 snprintf(where,len,"%x:%x:%x:%x:%x:%x:%x:%x",htons(ip->u.addr16[0]),htons(ip->u.addr16[1]),htons(ip->u.addr16[2]),
152
+	       htons(ip->u.addr16[3]), htons(ip->u.addr16[4]), htons(ip->u.addr16[5]), htons(ip->u.addr16[6]),
153
+	       htons(ip->u.addr16[7]));
154
+	 break;
155
+      default:
156
+	 break;
157
+   }
158
+}
159
+#endif