- 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,247 +0,0 @@ |
1 |
-/* |
|
2 |
- * global variables |
|
3 |
- * |
|
4 |
- * |
|
5 |
- * Copyright (C) 2001-2003 FhG Fokus |
|
6 |
- * |
|
7 |
- * This file is part of Kamailio, a free SIP server. |
|
8 |
- * |
|
9 |
- * Kamailio is free software; you can redistribute it and/or modify |
|
10 |
- * it under the terms of the GNU General Public License as published by |
|
11 |
- * the Free Software Foundation; either version 2 of the License, or |
|
12 |
- * (at your option) any later version |
|
13 |
- * |
|
14 |
- * Kamailio is distributed in the hope that it will be useful, |
|
15 |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
16 |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
17 |
- * GNU General Public License for more details. |
|
18 |
- * |
|
19 |
- * You should have received a copy of the GNU General Public License |
|
20 |
- * along with this program; if not, write to the Free Software |
|
21 |
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
|
22 |
- */ |
|
23 |
-/*! |
|
24 |
-* \file |
|
25 |
-* \brief Kamailio core :: Global variables |
|
26 |
-* \ingroup core |
|
27 |
-* Module: \ref core |
|
28 |
-*/ |
|
29 |
- |
|
30 |
- |
|
31 |
- |
|
32 |
-#ifndef globals_h |
|
33 |
-#define globals_h |
|
34 |
- |
|
35 |
-#include "types.h" |
|
36 |
-#include "ip_addr.h" |
|
37 |
-#include "str.h" |
|
38 |
-#include "poll_types.h" |
|
39 |
- |
|
40 |
-#define NO_DNS 0 |
|
41 |
-#define DO_DNS 1 |
|
42 |
-#define DO_REV_DNS 2 |
|
43 |
- |
|
44 |
- |
|
45 |
-extern char* mods_dir; /* directory with dyn. loadable modules */ |
|
46 |
-extern int mods_dir_cmd; /* marker if mods dir was set in command line */ |
|
47 |
-extern char* cfg_file; |
|
48 |
-extern int config_check; |
|
49 |
-extern char* stat_file; |
|
50 |
-extern unsigned short port_no; |
|
51 |
- |
|
52 |
-extern unsigned int sr_dst_max_branches; /* max number of branches per transaction */ |
|
53 |
- |
|
54 |
-extern time_t up_since; |
|
55 |
-extern pid_t creator_pid; /* pid of first process before daemonization */ |
|
56 |
-extern int uid; |
|
57 |
-extern int gid; |
|
58 |
-extern char* pid_file; |
|
59 |
-extern char* pgid_file; |
|
60 |
-extern int own_pgid; /* whether or not we have our own pgid (and it's ok to use kill(0, sig) */ |
|
61 |
- |
|
62 |
-extern int server_id; /* A unique ID of the SIP server */ |
|
63 |
- |
|
64 |
-extern struct socket_info* bind_address; /* pointer to the crt. proc. |
|
65 |
- listening address */ |
|
66 |
-extern struct socket_info* sendipv4; /* ipv4 socket to use when msg. |
|
67 |
- comes from ipv6*/ |
|
68 |
-extern struct socket_info* sendipv6; /* same as above for ipv6 */ |
|
69 |
-#ifdef USE_RAW_SOCKS |
|
70 |
-extern int raw_udp4_send_sock; |
|
71 |
-#endif /* USE_RAW_SOCKS */ |
|
72 |
- |
|
73 |
-#ifdef USE_TCP |
|
74 |
-extern struct socket_info* sendipv4_tcp; /* ipv4 socket to use when msg. |
|
75 |
- comes from ipv6*/ |
|
76 |
-extern struct socket_info* sendipv6_tcp; /* same as above for ipv6 */ |
|
77 |
-extern int unix_tcp_sock; /* socket used for communication with tcp main*/ |
|
78 |
-#endif |
|
79 |
-#ifdef USE_TLS |
|
80 |
-extern struct socket_info* sendipv4_tls; /* ipv4 socket to use when msg. |
|
81 |
- comes from ipv6*/ |
|
82 |
-extern struct socket_info* sendipv6_tls; /* same as above for ipv6 */ |
|
83 |
-#endif |
|
84 |
-#ifdef USE_SCTP |
|
85 |
-extern struct socket_info* sendipv4_sctp; /* ipv4 socket to use when msg. |
|
86 |
- comes from ipv6*/ |
|
87 |
-extern struct socket_info* sendipv6_sctp; /* same as above for ipv6 */ |
|
88 |
-#endif |
|
89 |
- |
|
90 |
-extern unsigned int maxbuffer; |
|
91 |
-extern unsigned int sql_buffer_size; |
|
92 |
-extern int children_no; |
|
93 |
-extern int socket_workers; |
|
94 |
-#ifdef USE_TCP |
|
95 |
-extern int tcp_main_pid; |
|
96 |
-extern int tcp_cfg_children_no; |
|
97 |
-extern int tcp_children_no; |
|
98 |
-extern int tcp_disable; |
|
99 |
-extern enum poll_types tcp_poll_method; |
|
100 |
-extern int tcp_max_connections; /* maximum tcp connections, hard limit */ |
|
101 |
-extern int tls_max_connections; /* maximum tls connections, hard limit */ |
|
102 |
-#endif |
|
103 |
-#ifdef USE_TLS |
|
104 |
-extern int tls_disable; |
|
105 |
-extern unsigned short tls_port_no; |
|
106 |
-#endif |
|
107 |
-#ifdef USE_SCTP |
|
108 |
-extern int sctp_disable; |
|
109 |
-extern int sctp_children_no; |
|
110 |
-#endif |
|
111 |
-extern int dont_fork; |
|
112 |
-extern int dont_daemonize; |
|
113 |
-extern int check_via; |
|
114 |
-extern int phone2tel; |
|
115 |
-extern int received_dns; |
|
116 |
-/* extern int process_no; */ |
|
117 |
-extern int child_rank; |
|
118 |
-extern int sip_warning; |
|
119 |
-extern int server_signature; |
|
120 |
-extern str server_hdr; |
|
121 |
-extern str user_agent_hdr; |
|
122 |
-extern char* user; |
|
123 |
-extern char* group; |
|
124 |
-extern char* sock_user; |
|
125 |
-extern char* sock_group; |
|
126 |
-extern int sock_uid; |
|
127 |
-extern int sock_gid; |
|
128 |
-extern int sock_mode; |
|
129 |
-extern char* chroot_dir; |
|
130 |
-extern char* working_dir; |
|
131 |
-extern char* runtime_dir; |
|
132 |
-extern int sr_auto_aliases; |
|
133 |
-extern int sr_msg_time; |
|
134 |
-extern str version_table; |
|
135 |
- |
|
136 |
-#ifdef USE_MCAST |
|
137 |
-extern int mcast_loopback; |
|
138 |
-extern int mcast_ttl; |
|
139 |
-extern char* mcast; |
|
140 |
-#endif /* USE_MCAST */ |
|
141 |
- |
|
142 |
-extern int auto_bind_ipv6; |
|
143 |
- |
|
144 |
-extern int tos; |
|
145 |
-extern int pmtu_discovery; |
|
146 |
- |
|
147 |
-/* |
|
148 |
- * debug & log_stderr moved to dprint.h*/ |
|
149 |
- |
|
150 |
-/* extern process_bm_t process_bit; */ |
|
151 |
-/* extern int *pids; -moved to pt.h */ |
|
152 |
- |
|
153 |
-extern int cfg_errors; |
|
154 |
-extern int cfg_warnings; |
|
155 |
-extern unsigned int msg_no; |
|
156 |
- |
|
157 |
-extern unsigned long shm_mem_size; |
|
158 |
-extern unsigned long pkg_mem_size; |
|
159 |
- |
|
160 |
-/* AVP configuration */ |
|
161 |
-extern char *avp_db_url; /* db url used by user preferences (AVPs) */ |
|
162 |
- |
|
163 |
-/* moved to pt.h |
|
164 |
-extern int *pids; |
|
165 |
-extern int process_no; |
|
166 |
-*/ |
|
167 |
- |
|
168 |
-extern int reply_to_via; |
|
169 |
- |
|
170 |
-extern int is_main; |
|
171 |
-extern int fixup_complete; |
|
172 |
- |
|
173 |
-/* debugging level for dumping memory status */ |
|
174 |
-extern int memlog; |
|
175 |
-/* debugging level for malloc debugging messages */ |
|
176 |
-extern int memdbg; |
|
177 |
- |
|
178 |
-/* debugging level for timer debugging (see -DTIMER_DEBUG) */ |
|
179 |
-extern int timerlog; |
|
180 |
- |
|
181 |
-/* looking up outbound interface ? */ |
|
182 |
-extern int mhomed; |
|
183 |
- |
|
184 |
-/* command-line arguments */ |
|
185 |
-extern int my_argc; |
|
186 |
-extern char **my_argv; |
|
187 |
- |
|
188 |
-/* pre-set addresses */ |
|
189 |
-extern str default_global_address; |
|
190 |
-/* pre-ser ports */ |
|
191 |
-extern str default_global_port; |
|
192 |
- |
|
193 |
-/* how much time to allow for shutdown, before killing everything */ |
|
194 |
-extern int ser_kill_timeout; |
|
195 |
- |
|
196 |
-/* core dump and file limits */ |
|
197 |
-extern int disable_core_dump; |
|
198 |
-extern int open_files_limit; |
|
199 |
- |
|
200 |
-/* memory lock/pre-fault */ |
|
201 |
-extern int shm_force_alloc; |
|
202 |
-extern int mlock_pages; |
|
203 |
- |
|
204 |
-/* execute onsend_route for replies */ |
|
205 |
-extern int onsend_route_reply; |
|
206 |
- |
|
207 |
-/* real time stuff */ |
|
208 |
-extern int real_time; |
|
209 |
-extern int rt_prio; |
|
210 |
-extern int rt_policy; /* SCHED_OTHER */ |
|
211 |
-extern int rt_timer1_prio; /* "fast" timer */ |
|
212 |
-extern int rt_timer2_prio; /* "slow" timer */ |
|
213 |
-extern int rt_timer1_policy; /* "fast" timer, SCHED_OTHER */ |
|
214 |
-extern int rt_timer2_policy; /* "slow" timer, SCHED_OTHER */ |
|
215 |
- |
|
216 |
-extern int http_reply_parse; |
|
217 |
- |
|
218 |
-#ifdef USE_DNS_CACHE |
|
219 |
-extern int dns_cache_init; /* if 0, the DNS cache is not initialized at startup */ |
|
220 |
-extern unsigned int dns_timer_interval; /* gc timer interval in s */ |
|
221 |
-extern int dns_flags; /* default flags used for the dns_*resolvehost |
|
222 |
- (compatibility wrappers) */ |
|
223 |
- |
|
224 |
-#ifdef USE_DNS_CACHE_STATS |
|
225 |
-struct t_dns_cache_stats{ |
|
226 |
- unsigned long dns_req_cnt; |
|
227 |
- unsigned long dc_hits_cnt; |
|
228 |
- unsigned long dc_neg_hits_cnt; |
|
229 |
- unsigned long dc_lru_cnt; |
|
230 |
-}; |
|
231 |
-extern struct t_dns_cache_stats* dns_cache_stats; |
|
232 |
-#endif /* USE_DNS_CACHE_STATS */ |
|
233 |
-#endif |
|
234 |
-#ifdef USE_DST_BLACKLIST |
|
235 |
-extern int dst_blacklist_init; /* if 0, the dst blacklist is not initialized at startup */ |
|
236 |
-extern unsigned int blst_timer_interval; /*blacklist gc timer interval (in s)*/ |
|
237 |
- |
|
238 |
-#ifdef USE_DST_BLACKLIST_STATS |
|
239 |
-struct t_dst_blacklist_stats{ |
|
240 |
- unsigned long bkl_hit_cnt; |
|
241 |
- unsigned long bkl_lru_cnt; |
|
242 |
-}; |
|
243 |
-extern struct t_dst_blacklist_stats* dst_blacklist_stats; |
|
244 |
-#endif /* USE_DST_BLACKLIST_STATS */ |
|
245 |
-#endif |
|
246 |
- |
|
247 |
-#endif |
- You can now define a mcast parameter before a listen parameter that
contains a multicast address. After each listen parameter mcast gets
reset. mcast must contain the name of an interface, eg `eth1`.
Issue GH#813
- to be used to build the path for runtime files (fifo, ctl)
... | ... |
@@ -1,24 +1,17 @@ |
1 | 1 |
/* |
2 |
- * $Id$ |
|
3 |
- * |
|
4 | 2 |
* global variables |
5 | 3 |
* |
6 | 4 |
* |
7 | 5 |
* Copyright (C) 2001-2003 FhG Fokus |
8 | 6 |
* |
9 |
- * This file is part of ser, a free SIP server. |
|
7 |
+ * This file is part of Kamailio, a free SIP server. |
|
10 | 8 |
* |
11 |
- * ser is free software; you can redistribute it and/or modify |
|
9 |
+ * Kamailio is free software; you can redistribute it and/or modify |
|
12 | 10 |
* it under the terms of the GNU General Public License as published by |
13 | 11 |
* the Free Software Foundation; either version 2 of the License, or |
14 | 12 |
* (at your option) any later version |
15 | 13 |
* |
16 |
- * For a license to use the ser software under conditions |
|
17 |
- * other than those described here, or to purchase support for this |
|
18 |
- * software, please contact iptel.org by e-mail at the following addresses: |
|
19 |
- * info@iptel.org |
|
20 |
- * |
|
21 |
- * ser is distributed in the hope that it will be useful, |
|
14 |
+ * Kamailio is distributed in the hope that it will be useful, |
|
22 | 15 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
23 | 16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
24 | 17 |
* GNU General Public License for more details. |
... | ... |
@@ -27,6 +20,12 @@ |
27 | 20 |
* along with this program; if not, write to the Free Software |
28 | 21 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
29 | 22 |
*/ |
23 |
+/*! |
|
24 |
+* \file |
|
25 |
+* \brief Kamailio core :: Global variables |
|
26 |
+* \ingroup core |
|
27 |
+* Module: \ref core |
|
28 |
+*/ |
|
30 | 29 |
|
31 | 30 |
|
32 | 31 |
|
- the maximum number of uac branches can be set via config
- default value is 12 (old static value for MAX_BRNACHES)
- the upper limit is 31, it has to be at least 1
- example:
max_branches=16
... | ... |
@@ -50,6 +50,8 @@ extern int config_check; |
50 | 50 |
extern char* stat_file; |
51 | 51 |
extern unsigned short port_no; |
52 | 52 |
|
53 |
+extern unsigned int sr_dst_max_branches; /* max number of branches per transaction */ |
|
54 |
+ |
|
53 | 55 |
extern time_t up_since; |
54 | 56 |
extern pid_t creator_pid; /* pid of first process before daemonization */ |
55 | 57 |
extern int uid; |
- control execution of onsend_route block for replies via parameter
onsend_route_reply
... | ... |
@@ -198,6 +198,9 @@ extern int open_files_limit; |
198 | 198 |
extern int shm_force_alloc; |
199 | 199 |
extern int mlock_pages; |
200 | 200 |
|
201 |
+/* execute onsend_route for replies */ |
|
202 |
+extern int onsend_route_reply; |
|
203 |
+ |
|
201 | 204 |
/* real time stuff */ |
202 | 205 |
extern int real_time; |
203 | 206 |
extern int rt_prio; |
- -L is in the group of options evaluated before config
... | ... |
@@ -25,7 +25,7 @@ |
25 | 25 |
* |
26 | 26 |
* You should have received a copy of the GNU General Public License |
27 | 27 |
* along with this program; if not, write to the Free Software |
28 |
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
28 |
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
|
29 | 29 |
*/ |
30 | 30 |
|
31 | 31 |
|
- a more relevant name for the core parameter that enables parsing http
replies
... | ... |
@@ -206,7 +206,7 @@ extern int rt_timer2_prio; /* "slow" timer */ |
206 | 206 |
extern int rt_timer1_policy; /* "fast" timer, SCHED_OTHER */ |
207 | 207 |
extern int rt_timer2_policy; /* "slow" timer, SCHED_OTHER */ |
208 | 208 |
|
209 |
-extern int http_reply_hack; |
|
209 |
+extern int http_reply_parse; |
|
210 | 210 |
|
211 | 211 |
#ifdef USE_DNS_CACHE |
212 | 212 |
extern int dns_cache_init; /* if 0, the DNS cache is not initialized at startup */ |
* remove syn_branch parameter and functionality from core and tm module for
calculating the Via branch parameter
* reported from Richard Brady, rnbrady at gmail dot com to sr-dev
* kamailio is not standard compliant with this setting enabled (RFC 3261,
17.2.3 and 16.11) for stateless forwarding of replies
* the performance reason that motivated this functionality are today not
valid anymore, even embedded systems have more than enough power to
calculate MD5 and other modules uses more expensive operations anyway
* adapt a bunch of example and test configuration that used this parameter,
it has been also removed from the core cookbook wiki
* Make IPv6 the default in the core and affected modules
* it has been default switched on since a long time, and was introduced in 2002
* even on embedded systems one probably want now proper IPv6 support
* there was an issue in cygwin in 2008, but IPv6 is there also available since v1.7
* remove over 160 #ifdefs, cleanup the code a lot and removes many of rarely
tested alternative code paths to ease support of the codebase
* note for gentoo maintainer: please review your packages, they will maybe not
work now correctly anymore if somebody specified -ipv6 in the use flags
- Added hooks so that STUN messages can be passed to a module
- Removed STUN configuration file parameters
... | ... |
@@ -136,12 +136,6 @@ extern int mcast_loopback; |
136 | 136 |
extern int mcast_ttl; |
137 | 137 |
#endif /* USE_MCAST */ |
138 | 138 |
|
139 |
-#ifdef USE_STUN |
|
140 |
-extern unsigned int stun_refresh_interval; |
|
141 |
-extern int stun_allow_stun; |
|
142 |
-extern int stun_allow_fp; |
|
143 |
-#endif |
|
144 |
- |
|
145 | 139 |
#ifdef USE_IPV6 |
146 | 140 |
extern int auto_bind_ipv6; |
147 | 141 |
#endif |
When kamailio is part of a bigger project and is sharing its database with
it, it is nice to have a less generic table name than "version".
Also usefull when upgrading kamailio, where the new version has (backwards
compatibel) changes in the database definition. If each kamailio version uses
its own version table, they can all use the same database.
- new parameter msg_time to set the timeval value at receive time (1
(on) by default, set to 0 to disable)
- the value is set automatically at received time based if msg_time=1 or
first time when it is accessed
- the field should bring coherence regarting time of the message - it
should be the same no matter where is processed
- By default it is off, to turn it on set http_reply_hack=yes in kamailio.cfg
- You need to turn this on if you use xhttp _and_ event_route[sl:local-response].
This is because HTTP responses are stateless responses and when the
event_route is run it has to parse the response. Without HTTP_REPLY_HACK
Kamailio can't actually parse HTTP responses.
... | ... |
@@ -213,6 +213,7 @@ extern int rt_timer2_prio; /* "slow" timer */ |
213 | 213 |
extern int rt_timer1_policy; /* "fast" timer, SCHED_OTHER */ |
214 | 214 |
extern int rt_timer2_policy; /* "slow" timer, SCHED_OTHER */ |
215 | 215 |
|
216 |
+extern int http_reply_hack; |
|
216 | 217 |
|
217 | 218 |
#ifdef USE_DNS_CACHE |
218 | 219 |
extern int dns_cache_init; /* if 0, the DNS cache is not initialized at startup */ |
- new cfg global parameter: socket_workers - set the number of worker
processes for the next listen socket
- used before listen on udp and sctp socket - overwrites
children/sctp_children value for that socket
- used bofer listen on tcp and tls socket - adds extra tcp workers,
these handling traffic only on that socket
- socket_workers is reset with next listen socket that is added, thus
use it for each listen socket where you want custom number of workers
- if this parameter is not used at all, it is the same behaviour as so
far
Example for udp sockets:
children=4
socket_workers=2
listen=udp:127.0.0.1:5080
listen=udp:127.0.0.1:5070
listen=udp:127.0.0.1:5060
- it will start 2 workers to handle traffic on udp:127.0.0.1:5080 and 4
for each of udp:127.0.0.1:5070 and udp:127.0.0.1:5060. In total there
are 10 worker processes
Example for tcp sockets:
children=4
socket_workers=2
listen=tcp:127.0.0.1:5080
listen=tcp:127.0.0.1:5070
listen=tcp:127.0.0.1:5060
- it will start 2 workers to handle traffic on tcp:127.0.0.1:5080 and 4
to handle traffic on both tcp:127.0.0.1:5070 and tcp:127.0.0.1:5060.
In total there are 6 worker processes
... | ... |
@@ -88,8 +88,10 @@ extern struct socket_info* sendipv6_sctp; /* same as above for ipv6 */ |
88 | 88 |
extern unsigned int maxbuffer; |
89 | 89 |
extern unsigned int sql_buffer_size; |
90 | 90 |
extern int children_no; |
91 |
+extern int socket_workers; |
|
91 | 92 |
#ifdef USE_TCP |
92 | 93 |
extern int tcp_main_pid; |
94 |
+extern int tcp_cfg_children_no; |
|
93 | 95 |
extern int tcp_children_no; |
94 | 96 |
extern int tcp_disable; |
95 | 97 |
extern enum poll_types tcp_poll_method; |
- set a limit to active tls connections
- its management is done in tcp code, as tls is encryption layer over
tcp
- tls connections are still counted as tcp connections, thus this limit
cannot exceed tcp_max_connections
- default value 2048
- core.tcp_options lists also the tls connections number
... | ... |
@@ -93,7 +93,8 @@ extern int tcp_main_pid; |
93 | 93 |
extern int tcp_children_no; |
94 | 94 |
extern int tcp_disable; |
95 | 95 |
extern enum poll_types tcp_poll_method; |
96 |
-extern int tcp_max_connections; /* maximum connections, hard limit */ |
|
96 |
+extern int tcp_max_connections; /* maximum tcp connections, hard limit */ |
|
97 |
+extern int tls_max_connections; /* maximum tls connections, hard limit */ |
|
97 | 98 |
#endif |
98 | 99 |
#ifdef USE_TLS |
99 | 100 |
extern int tls_disable; |
- Currently the SQL buffer size is hard-coded to 64k. This isn't
enough in some cases. For example, it is easily possible for
resource lists (which can be Network Address Books) to be larger
than 64k.
- The default buffer size is still 64k, but this can be overriden
with the new "sql_buffer_size" configuration option.
- Support added for mediumblob/mediumtext in MySQL as the blob/text
types that are currently supported are limited to 64k.
- Feature added by Andrew Miller at Crocodile RCS
The pkg mem size used can be configured by using the "-M"
parameter on the command line, e.g.:
ser -M 8 -f test.cfg # start ser with 8mb of pkg memory
The default remains 4Mb.
Usage of raw sockets for send and the used mtu can now be set
at runtime via the 2 new added core config variables:
udp4_raw and udp4_raw_mtu.
udp4_raw can have 3 values: disabled (0), on (1) and auto (-1). If
set to auto raw sockets will be used if possible.
E.g.:
sercmd cfg.set_now_int core udp4_raw_mtu 576
... | ... |
@@ -64,6 +64,10 @@ extern struct socket_info* bind_address; /* pointer to the crt. proc. |
64 | 64 |
extern struct socket_info* sendipv4; /* ipv4 socket to use when msg. |
65 | 65 |
comes from ipv6*/ |
66 | 66 |
extern struct socket_info* sendipv6; /* same as above for ipv6 */ |
67 |
+#ifdef USE_RAW_SOCKS |
|
68 |
+extern int raw_udp4_send_sock; |
|
69 |
+#endif /* USE_RAW_SOCKS */ |
|
70 |
+ |
|
67 | 71 |
#ifdef USE_TCP |
68 | 72 |
extern struct socket_info* sendipv4_tcp; /* ipv4 socket to use when msg. |
69 | 73 |
comes from ipv6*/ |
- server and user agent signature were only defines so far
- two new parameters server_header and user_agent_header allow
to define them via cfg parameters
- default values are the same so far
- parameter takes boolean value
- if set, rev dns results are added to aliases list
- default is set
- added tcp_connect_timeout, tcp_send_timeout,
tcp_connection_lifetime, tcp_max_connections, tcp_accept_aliases
to the config framework.
- added 2 new tcp related variables: tcp alias_flags and tcp
new_conn_alias_flags
... | ... |
@@ -87,12 +87,8 @@ extern int children_no; |
87 | 87 |
extern int tcp_main_pid; |
88 | 88 |
extern int tcp_children_no; |
89 | 89 |
extern int tcp_disable; |
90 |
-extern int tcp_accept_aliases; |
|
91 |
-extern int tcp_connect_timeout; |
|
92 |
-extern int tcp_send_timeout; |
|
93 |
-extern int tcp_con_lifetime; /* connection lifetime */ |
|
94 | 90 |
extern enum poll_types tcp_poll_method; |
95 |
-extern int tcp_max_connections; |
|
91 |
+extern int tcp_max_connections; /* maximum connections, hard limit */ |
|
96 | 92 |
#endif |
97 | 93 |
#ifdef USE_TLS |
98 | 94 |
extern int tls_disable; |
... | ... |
@@ -75,6 +75,11 @@ extern struct socket_info* sendipv4_tls; /* ipv4 socket to use when msg. |
75 | 75 |
comes from ipv6*/ |
76 | 76 |
extern struct socket_info* sendipv6_tls; /* same as above for ipv6 */ |
77 | 77 |
#endif |
78 |
+#ifdef USE_SCTP |
|
79 |
+extern struct socket_info* sendipv4_sctp; /* ipv4 socket to use when msg. |
|
80 |
+ comes from ipv6*/ |
|
81 |
+extern struct socket_info* sendipv6_sctp; /* same as above for ipv6 */ |
|
82 |
+#endif |
|
78 | 83 |
|
79 | 84 |
extern unsigned int maxbuffer; |
80 | 85 |
extern int children_no; |
... | ... |
@@ -93,6 +98,10 @@ extern int tcp_max_connections; |
93 | 98 |
extern int tls_disable; |
94 | 99 |
extern unsigned short tls_port_no; |
95 | 100 |
#endif |
101 |
+#ifdef USE_SCTP |
|
102 |
+extern int sctp_disable; |
|
103 |
+extern int sctp_children_no; |
|
104 |
+#endif |
|
96 | 105 |
extern int dont_fork; |
97 | 106 |
extern int dont_daemonize; |
98 | 107 |
extern int check_via; |
... | ... |
@@ -56,6 +56,8 @@ extern char* pid_file; |
56 | 56 |
extern char* pgid_file; |
57 | 57 |
extern int own_pgid; /* whether or not we have our own pgid (and it's ok to use kill(0, sig) */ |
58 | 58 |
|
59 |
+extern int server_id; /* A unique ID of the SIP server */ |
|
60 |
+ |
|
59 | 61 |
extern struct socket_info* bind_address; /* pointer to the crt. proc. |
60 | 62 |
listening address */ |
61 | 63 |
extern struct socket_info* sendipv4; /* ipv4 socket to use when msg. |
... | ... |
@@ -191,7 +191,7 @@ extern int rt_timer2_policy; /* "slow" timer, SCHED_OTHER */ |
191 | 191 |
|
192 | 192 |
|
193 | 193 |
#ifdef USE_DNS_CACHE |
194 |
-extern int use_dns_cache; /* 1 if the cache is enabled, 0 otherwise */ |
|
194 |
+extern int dns_cache_init; /* if 0, the DNS cache is not initialized at startup */ |
|
195 | 195 |
extern unsigned int dns_timer_interval; /* gc timer interval in s */ |
196 | 196 |
extern int dns_flags; /* default flags used for the dns_*resolvehost |
197 | 197 |
(compatibility wrappers) */ |
... | ... |
@@ -207,6 +207,7 @@ extern struct t_dns_cache_stats* dns_cache_stats; |
207 | 207 |
#endif /* USE_DNS_CACHE_STATS */ |
208 | 208 |
#endif |
209 | 209 |
#ifdef USE_DST_BLACKLIST |
210 |
+extern int dst_blacklist_init; /* if 0, the dst blacklist is not initialized at startup */ |
|
210 | 211 |
extern unsigned int blst_timer_interval; /*blacklist gc timer interval (in s)*/ |
211 | 212 |
|
212 | 213 |
#ifdef USE_DST_BLACKLIST_STATS |
- The resolver is reinitialized by each child process separately
when dns_retr_time, dns_retr_no, dns_servers_no, or dns_use_search_list
is changed.
- dns_reinit is introduced: the resolver is reinitialized when the
variable is set to 1, and the variable is reseted to 0 again.
It can be set via RPC for example, when /etc/resolv.conf changes,
but none of the SER config parameters are affected.
- A callback function is called by each child process after the resolver
has been reinitialized, if DNS_WATCHDOG_SUPPORT is enabled.
- socket_types is changed to be a global variable, and set by
fix_all_socket_lists(), because we have to remember for
the socket types, and do not allow dns_try_ipv6 to be enabled if there
is no ipv6 interface.
- minor bug is corrected: the expiration check is removed from
dns_cache_clean() function, when non-expired entries are deleted.
... | ... |
@@ -190,26 +190,11 @@ extern int rt_timer1_policy; /* "fast" timer, SCHED_OTHER */ |
190 | 190 |
extern int rt_timer2_policy; /* "slow" timer, SCHED_OTHER */ |
191 | 191 |
|
192 | 192 |
|
193 |
- |
|
194 |
-/* resolver */ |
|
195 |
-extern int dns_retr_time; |
|
196 |
-extern int dns_retr_no; |
|
197 |
-extern int dns_servers_no; |
|
198 |
-extern int dns_search_list; |
|
199 |
-extern int dns_search_fmatch; |
|
200 | 193 |
#ifdef USE_DNS_CACHE |
201 | 194 |
extern int use_dns_cache; /* 1 if the cache is enabled, 0 otherwise */ |
202 |
-extern int use_dns_failover; /* 1 if failover is enabled, 0 otherwise */ |
|
203 |
-extern unsigned int dns_cache_max_mem; /* maximum memory used for the cached |
|
204 |
- entries*/ |
|
205 |
-extern unsigned int dns_neg_cache_ttl; /* neg. cache ttl */ |
|
206 |
-extern unsigned int dns_cache_max_ttl; /* maximum ttl */ |
|
207 |
-extern unsigned int dns_cache_min_ttl; /* minimum ttl */ |
|
208 | 195 |
extern unsigned int dns_timer_interval; /* gc timer interval in s */ |
209 | 196 |
extern int dns_flags; /* default flags used for the dns_*resolvehost |
210 | 197 |
(compatibility wrappers) */ |
211 |
-extern int dns_srv_lb; /* default SRV LB support value */ |
|
212 |
-extern int dns_cache_del_nonexp; /* delete non-expired values from the cache when it is full */ |
|
213 | 198 |
|
214 | 199 |
#ifdef USE_DNS_CACHE_STATS |
215 | 200 |
struct t_dns_cache_stats{ |
- use_dst_blacklist
- dst_blacklist_expire
- dst_blacklist_mem
... | ... |
@@ -222,10 +222,6 @@ extern struct t_dns_cache_stats* dns_cache_stats; |
222 | 222 |
#endif /* USE_DNS_CACHE_STATS */ |
223 | 223 |
#endif |
224 | 224 |
#ifdef USE_DST_BLACKLIST |
225 |
-extern int use_dst_blacklist; /* 1 if the blacklist is enabled */ |
|
226 |
-extern unsigned int blst_max_mem; /* maximum memory used for the blacklist |
|
227 |
- entries*/ |
|
228 |
-extern unsigned int blst_timeout; /* blacklist entry ttl */ |
|
229 | 225 |
extern unsigned int blst_timer_interval; /*blacklist gc timer interval (in s)*/ |
230 | 226 |
|
231 | 227 |
#ifdef USE_DST_BLACKLIST_STATS |
Change to DNS subsystem: if search list used (not recomended) and name
was resolved using the search list, the link between the short name (query)
and the long name (answer) is stored in DNS cache as fake CNAME record.
New config script setting available (dns_search_full_match) which controls,
whether SER will check if the extension of the name is present in search list
(defualt) or blindly accepted (faster, but little bit risky for spoofed
DNS replies)
... | ... |
@@ -196,6 +196,7 @@ extern int dns_retr_time; |
196 | 196 |
extern int dns_retr_no; |
197 | 197 |
extern int dns_servers_no; |
198 | 198 |
extern int dns_search_list; |
199 |
+extern int dns_search_fmatch; |
|
199 | 200 |
#ifdef USE_DNS_CACHE |
200 | 201 |
extern int use_dns_cache; /* 1 if the cache is enabled, 0 otherwise */ |
201 | 202 |
extern int use_dns_failover; /* 1 if failover is enabled, 0 otherwise */ |
globals.h:
* added mods_dir variable
main.c:
* added `-L dir' option
* fixed Usage message which referred to the non-existent
`-p port' option
* fixed parsing of command-line options - options with missing
arguments were incorrectly reported as unknown options
sr_module.c:
* load_module() - added possibilty to load modules by name,
the path to the module file is <mods_dir>/<name>.so
(if EXTRA_DEBUG macro is defined <mods_dir>/<name>/<name>.so
is tried too) where <mods_dir> can be specified using `-L dir'
option on the command-line, otherwise the default value MODS_DIR
is used
... | ... |
@@ -43,10 +43,10 @@ |
43 | 43 |
#define DO_REV_DNS 2 |
44 | 44 |
|
45 | 45 |
|
46 |
- |
|
47 |
-extern char * cfg_file; |
|
46 |
+extern char* mods_dir; /* directory with dyn. loadable modules */ |
|
47 |
+extern char* cfg_file; |
|
48 | 48 |
extern int config_check; |
49 |
-extern char *stat_file; |
|
49 |
+extern char* stat_file; |
|
50 | 50 |
extern unsigned short port_no; |
51 | 51 |
|
52 | 52 |
extern pid_t creator_pid; /* pid of first process before daemonization */ |
* 2007-09-10 introduced phone2uri option which allows NOT to consider
* user=phone URIs as TEL URIs
... | ... |
@@ -206,6 +206,7 @@ extern unsigned int dns_timer_interval; /* gc timer interval in s */ |
206 | 206 |
extern int dns_flags; /* default flags used for the dns_*resolvehost |
207 | 207 |
(compatibility wrappers) */ |
208 | 208 |
extern int dns_srv_lb; /* default SRV LB support value */ |
209 |
+extern int dns_cache_del_nonexp; /* delete non-expired values from the cache when it is full */ |
|
209 | 210 |
|
210 | 211 |
#ifdef USE_DNS_CACHE_STATS |
211 | 212 |
struct t_dns_cache_stats{ |
... | ... |
@@ -23,8 +23,8 @@ |
23 | 23 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
24 | 24 |
* GNU General Public License for more details. |
25 | 25 |
* |
26 |
- * You should have received a copy of the GNU General Public License |
|
27 |
- * along with this program; if not, write to the Free Software |
|
26 |
+ * You should have received a copy of the GNU General Public License |
|
27 |
+ * along with this program; if not, write to the Free Software |
|
28 | 28 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
29 | 29 |
*/ |
30 | 30 |
|
... | ... |
@@ -179,7 +179,7 @@ extern int shm_force_alloc; |
179 | 179 |
extern int mlock_pages; |
180 | 180 |
|
181 | 181 |
/* real time stuff */ |
182 |
-extern int real_time; |
|
182 |
+extern int real_time; |
|
183 | 183 |
extern int rt_prio; |
184 | 184 |
extern int rt_policy; /* SCHED_OTHER */ |
185 | 185 |
extern int rt_timer1_prio; /* "fast" timer */ |
... | ... |
@@ -197,23 +197,40 @@ extern int dns_search_list; |
197 | 197 |
#ifdef USE_DNS_CACHE |
198 | 198 |
extern int use_dns_cache; /* 1 if the cache is enabled, 0 otherwise */ |
199 | 199 |
extern int use_dns_failover; /* 1 if failover is enabled, 0 otherwise */ |
200 |
-extern unsigned int dns_cache_max_mem; /* maximum memory used for the cached |
|
200 |
+extern unsigned int dns_cache_max_mem; /* maximum memory used for the cached |
|
201 | 201 |
entries*/ |
202 | 202 |
extern unsigned int dns_neg_cache_ttl; /* neg. cache ttl */ |
203 | 203 |
extern unsigned int dns_cache_max_ttl; /* maximum ttl */ |
204 | 204 |
extern unsigned int dns_cache_min_ttl; /* minimum ttl */ |
205 | 205 |
extern unsigned int dns_timer_interval; /* gc timer interval in s */ |
206 |
-extern int dns_flags; /* default flags used for the dns_*resolvehost |
|
206 |
+extern int dns_flags; /* default flags used for the dns_*resolvehost |
|
207 | 207 |
(compatibility wrappers) */ |
208 | 208 |
extern int dns_srv_lb; /* default SRV LB support value */ |
209 | 209 |
|
210 |
+#ifdef USE_DNS_CACHE_STATS |
|
211 |
+struct t_dns_cache_stats{ |
|
212 |
+ unsigned long dns_req_cnt; |
|
213 |
+ unsigned long dc_hits_cnt; |
|
214 |
+ unsigned long dc_neg_hits_cnt; |
|
215 |
+ unsigned long dc_lru_cnt; |
|
216 |
+}; |
|
217 |
+extern struct t_dns_cache_stats* dns_cache_stats; |
|
218 |
+#endif /* USE_DNS_CACHE_STATS */ |
|
210 | 219 |
#endif |
211 | 220 |
#ifdef USE_DST_BLACKLIST |
212 | 221 |
extern int use_dst_blacklist; /* 1 if the blacklist is enabled */ |
213 |
-extern unsigned int blst_max_mem; /* maximum memory used for the blacklist |
|
222 |
+extern unsigned int blst_max_mem; /* maximum memory used for the blacklist |
|
214 | 223 |
entries*/ |
215 | 224 |
extern unsigned int blst_timeout; /* blacklist entry ttl */ |
216 | 225 |
extern unsigned int blst_timer_interval; /*blacklist gc timer interval (in s)*/ |
226 |
+ |
|
227 |
+#ifdef USE_DST_BLACKLIST_STATS |
|
228 |
+struct t_dst_blacklist_stats{ |
|
229 |
+ unsigned long bkl_hit_cnt; |
|
230 |
+ unsigned long bkl_lru_cnt; |
|
231 |
+}; |
|
232 |
+extern struct t_dst_blacklist_stats* dst_blacklist_stats; |
|
233 |
+#endif /* USE_DST_BLACKLIST_STATS */ |
|
217 | 234 |
#endif |
218 | 235 |
|
219 | 236 |
#endif |
... | ... |
@@ -85,12 +85,6 @@ extern int tcp_send_timeout; |
85 | 85 |
extern int tcp_con_lifetime; /* connection lifetime */ |
86 | 86 |
extern enum poll_types tcp_poll_method; |
87 | 87 |
extern int tcp_max_connections; |
88 |
-extern int tcp_use_source_ipv4; |
|
89 |
-extern struct sockaddr_in tcp_source_ipv4; |
|
90 |
-#ifdef USE_IPV6 |
|
91 |
-extern int tcp_use_source_ipv6; |
|
92 |
-extern struct sockaddr_in6 tcp_source_ipv6; |
|
93 |
-#endif |
|
94 | 88 |
#endif |
95 | 89 |
#ifdef USE_TLS |
96 | 90 |
extern int tls_disable; |
... | ... |
@@ -84,7 +84,6 @@ extern int tcp_connect_timeout; |
84 | 84 |
extern int tcp_send_timeout; |
85 | 85 |
extern int tcp_con_lifetime; /* connection lifetime */ |
86 | 86 |
extern enum poll_types tcp_poll_method; |
87 |
-extern int tcp_max_fd_no; |
|
88 | 87 |
extern int tcp_max_connections; |
89 | 88 |
extern int tcp_use_source_ipv4; |
90 | 89 |
extern struct sockaddr_in tcp_source_ipv4; |
For more info see doc/dns.txt.
... | ... |
@@ -212,6 +212,8 @@ extern unsigned int dns_cache_min_ttl; /* minimum ttl */ |
212 | 212 |
extern unsigned int dns_timer_interval; /* gc timer interval in s */ |
213 | 213 |
extern int dns_flags; /* default flags used for the dns_*resolvehost |
214 | 214 |
(compatibility wrappers) */ |
215 |
+extern int dns_srv_lb; /* default SRV LB support value */ |
|
216 |
+ |
|
215 | 217 |
#endif |
216 | 218 |
#ifdef USE_DST_BLACKLIST |
217 | 219 |
extern int use_dst_blacklist; /* 1 if the blacklist is enabled */ |
... | ... |
@@ -175,12 +175,27 @@ extern str default_global_address; |
175 | 175 |
extern str default_global_port; |
176 | 176 |
|
177 | 177 |
/* how much time to allow for shutdown, before killing everything */ |
178 |
-int ser_kill_timeout; |
|
178 |
+extern int ser_kill_timeout; |
|
179 | 179 |
|
180 | 180 |
/* core dump and file limits */ |
181 | 181 |
extern int disable_core_dump; |
182 | 182 |
extern int open_files_limit; |
183 | 183 |
|
184 |
+/* memory lock/pre-fault */ |
|
185 |
+extern int shm_force_alloc; |
|
186 |
+extern int mlock_pages; |
|
187 |
+ |
|
188 |
+/* real time stuff */ |
|
189 |
+extern int real_time; |
|
190 |
+extern int rt_prio; |
|
191 |
+extern int rt_policy; /* SCHED_OTHER */ |
|
192 |
+extern int rt_timer1_prio; /* "fast" timer */ |
|
193 |
+extern int rt_timer2_prio; /* "slow" timer */ |
|
194 |
+extern int rt_timer1_policy; /* "fast" timer, SCHED_OTHER */ |
|
195 |
+extern int rt_timer2_policy; /* "slow" timer, SCHED_OTHER */ |
|
196 |
+ |
|
197 |
+ |
|
198 |
+ |
|
184 | 199 |
/* resolver */ |
185 | 200 |
extern int dns_retr_time; |
186 | 201 |
extern int dns_retr_no; |
... | ... |
@@ -189,19 +204,21 @@ extern int dns_search_list; |
189 | 204 |
#ifdef USE_DNS_CACHE |
190 | 205 |
extern int use_dns_cache; /* 1 if the cache is enabled, 0 otherwise */ |
191 | 206 |
extern int use_dns_failover; /* 1 if failover is enabled, 0 otherwise */ |
192 |
-unsigned int dns_cache_max_mem; /* maximum memory used for the cached entries*/ |
|
193 |
-unsigned int dns_neg_cache_ttl; /* neg. cache ttl */ |
|
194 |
-unsigned int dns_cache_max_ttl; /* maximum ttl */ |
|
195 |
-unsigned int dns_cache_min_ttl; /* minimum ttl */ |
|
196 |
-unsigned int dns_timer_interval; /* gc timer interval in s */ |
|
197 |
-int dns_flags; /* default flags used for the dns_*resolvehost |
|
207 |
+extern unsigned int dns_cache_max_mem; /* maximum memory used for the cached |
|
208 |
+ entries*/ |
|
209 |
+extern unsigned int dns_neg_cache_ttl; /* neg. cache ttl */ |
|
210 |
+extern unsigned int dns_cache_max_ttl; /* maximum ttl */ |
|
211 |
+extern unsigned int dns_cache_min_ttl; /* minimum ttl */ |
|
212 |
+extern unsigned int dns_timer_interval; /* gc timer interval in s */ |
|
213 |
+extern int dns_flags; /* default flags used for the dns_*resolvehost |
|
198 | 214 |
(compatibility wrappers) */ |
199 | 215 |
#endif |
200 | 216 |
#ifdef USE_DST_BLACKLIST |
201 | 217 |
extern int use_dst_blacklist; /* 1 if the blacklist is enabled */ |
202 |
-unsigned int blst_max_mem; /* maximum memory used for the blacklist entries*/ |
|
203 |
-unsigned int blst_timeout; /* blacklist entry ttl */ |
|
204 |
-unsigned int blst_timer_interval; /* blacklist gc timer interval (in s)*/ |
|
218 |
+extern unsigned int blst_max_mem; /* maximum memory used for the blacklist |
|
219 |
+ entries*/ |
|
220 |
+extern unsigned int blst_timeout; /* blacklist entry ttl */ |
|
221 |
+extern unsigned int blst_timer_interval; /*blacklist gc timer interval (in s)*/ |
|
205 | 222 |
#endif |
206 | 223 |
|
207 | 224 |
#endif |
Patch provided by Jan Andres <jan.andres@freenet-ag.de>
Closes SER-277
... | ... |
@@ -86,6 +86,12 @@ extern int tcp_con_lifetime; /* connection lifetime */ |
86 | 86 |
extern enum poll_types tcp_poll_method; |
87 | 87 |
extern int tcp_max_fd_no; |
88 | 88 |
extern int tcp_max_connections; |
89 |
+extern int tcp_use_source_ipv4; |
|
90 |
+extern struct sockaddr_in tcp_source_ipv4; |
|
91 |
+#ifdef USE_IPV6 |
|
92 |
+extern int tcp_use_source_ipv6; |
|
93 |
+extern struct sockaddr_in6 tcp_source_ipv6; |
|
94 |
+#endif |
|
89 | 95 |
#endif |
90 | 96 |
#ifdef USE_TLS |
91 | 97 |
extern int tls_disable; |
... | ... |
@@ -76,6 +76,7 @@ extern struct socket_info* sendipv6_tls; /* same as above for ipv6 */ |
76 | 76 |
extern unsigned int maxbuffer; |
77 | 77 |
extern int children_no; |
78 | 78 |
#ifdef USE_TCP |
79 |
+extern int tcp_main_pid; |
|
79 | 80 |
extern int tcp_children_no; |
80 | 81 |
extern int tcp_disable; |
81 | 82 |
extern int tcp_accept_aliases; |
... | ... |
@@ -166,6 +166,9 @@ extern str default_global_address; |
166 | 166 |
/* pre-ser ports */ |
167 | 167 |
extern str default_global_port; |
168 | 168 |
|
169 |
+/* how much time to allow for shutdown, before killing everything */ |
|
170 |
+int ser_kill_timeout; |
|
171 |
+ |
|
169 | 172 |
/* core dump and file limits */ |
170 | 173 |
extern int disable_core_dump; |
171 | 174 |
extern int open_files_limit; |
... | ... |
@@ -114,6 +114,12 @@ extern int mcast_loopback; |
114 | 114 |
extern int mcast_ttl; |
115 | 115 |
#endif /* USE_MCAST */ |
116 | 116 |
|
117 |
+#ifdef USE_STUN |
|
118 |
+extern unsigned int stun_refresh_interval; |
|
119 |
+extern int stun_allow_stun; |
|
120 |
+extern int stun_allow_fp; |
|
121 |
+#endif |
|
122 |
+ |
|
117 | 123 |
extern int tos; |
118 | 124 |
|
119 | 125 |
/* |
WARNING: there are a lot of changes in tm