5 * Copyright (C) 2001-2003 FhG Fokus
7 * This file is part of Kamailio, a free SIP server.
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
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.
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
25 * \brief Kamailio core :: Global variables
37 #include "poll_types.h"
44 extern char* mods_dir; /* directory with dyn. loadable modules */
45 extern int mods_dir_cmd; /* marker if mods dir was set in command line */
46 extern char* cfg_file;
47 extern int config_check;
48 extern char* stat_file;
49 extern unsigned short port_no;
51 extern unsigned int sr_dst_max_branches; /* max number of branches per transaction */
53 extern time_t up_since;
54 extern pid_t creator_pid; /* pid of first process before daemonization */
57 extern char* pid_file;
58 extern char* pgid_file;
59 extern int own_pgid; /* whether or not we have our own pgid (and it's ok to use kill(0, sig) */
61 extern int server_id; /* A unique ID of the SIP server */
63 extern struct socket_info* bind_address; /* pointer to the crt. proc.
65 extern struct socket_info* sendipv4; /* ipv4 socket to use when msg.
67 extern struct socket_info* sendipv6; /* same as above for ipv6 */
69 extern int raw_udp4_send_sock;
70 #endif /* USE_RAW_SOCKS */
73 extern struct socket_info* sendipv4_tcp; /* ipv4 socket to use when msg.
75 extern struct socket_info* sendipv6_tcp; /* same as above for ipv6 */
76 extern int unix_tcp_sock; /* socket used for communication with tcp main*/
79 extern struct socket_info* sendipv4_tls; /* ipv4 socket to use when msg.
81 extern struct socket_info* sendipv6_tls; /* same as above for ipv6 */
84 extern struct socket_info* sendipv4_sctp; /* ipv4 socket to use when msg.
86 extern struct socket_info* sendipv6_sctp; /* same as above for ipv6 */
89 extern unsigned int maxbuffer;
90 extern unsigned int sql_buffer_size;
91 extern int children_no;
92 extern int socket_workers;
94 extern int tcp_main_pid;
95 extern int tcp_cfg_children_no;
96 extern int tcp_children_no;
97 extern int tcp_disable;
98 extern enum poll_types tcp_poll_method;
99 extern int tcp_max_connections; /* maximum tcp connections, hard limit */
100 extern int tls_max_connections; /* maximum tls connections, hard limit */
102 extern int ksr_tcp_accept_hep3;
104 extern int tls_disable;
105 extern unsigned short tls_port_no;
108 extern int sctp_disable;
109 extern int sctp_children_no;
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 child_rank;
117 extern int sip_warning;
118 extern int server_signature;
119 extern str server_hdr;
120 extern str user_agent_hdr;
123 extern char* sock_user;
124 extern char* sock_group;
127 extern int sock_mode;
128 extern char* chroot_dir;
129 extern char* working_dir;
130 extern char* runtime_dir;
131 extern int sr_auto_aliases;
132 extern int sr_msg_time;
133 extern str version_table;
136 extern int mcast_loopback;
137 extern int mcast_ttl;
139 #endif /* USE_MCAST */
141 extern int auto_bind_ipv6;
144 extern int pmtu_discovery;
146 extern int cfg_errors;
147 extern int cfg_warnings;
148 extern unsigned int msg_no;
150 extern unsigned long shm_mem_size;
151 extern unsigned long pkg_mem_size;
153 /* AVP configuration */
154 extern char *avp_db_url; /* db url used by user preferences (AVPs) */
156 extern int reply_to_via;
159 extern int fixup_complete;
161 /* debugging level for dumping memory status */
163 /* debugging level for malloc debugging messages */
166 /* debugging level for timer debugging (see -DTIMER_DEBUG) */
169 /* looking up outbound interface ? */
172 /* command-line arguments */
174 extern char **my_argv;
176 /* pre-set addresses */
177 extern str default_global_address;
179 extern str default_global_port;
181 /* how much time to allow for shutdown, before killing everything */
182 extern int ser_kill_timeout;
184 /* core dump and file limits */
185 extern int disable_core_dump;
186 extern int open_files_limit;
188 /* memory lock/pre-fault */
189 extern int shm_force_alloc;
190 extern int mlock_pages;
192 /* execute onsend_route for replies */
193 extern int onsend_route_reply;
195 /* real time stuff */
196 extern int real_time;
198 extern int rt_policy; /* SCHED_OTHER */
199 extern int rt_timer1_prio; /* "fast" timer */
200 extern int rt_timer2_prio; /* "slow" timer */
201 extern int rt_timer1_policy; /* "fast" timer, SCHED_OTHER */
202 extern int rt_timer2_policy; /* "slow" timer, SCHED_OTHER */
204 extern int http_reply_parse;
205 extern int _sr_ip_free_bind;
206 extern int ksr_verbose_startup;
207 extern int ksr_route_locks_size;
208 extern str _ksr_xavp_via_params;
211 extern int dns_cache_init; /* if 0, the DNS cache is not initialized at startup */
212 extern unsigned int dns_timer_interval; /* gc timer interval in s */
213 extern int dns_flags; /* default flags used for the dns_*resolvehost
214 (compatibility wrappers) */
216 #ifdef USE_DNS_CACHE_STATS
217 struct t_dns_cache_stats{
218 unsigned long dns_req_cnt;
219 unsigned long dc_hits_cnt;
220 unsigned long dc_neg_hits_cnt;
221 unsigned long dc_lru_cnt;
223 extern struct t_dns_cache_stats* dns_cache_stats;
224 #endif /* USE_DNS_CACHE_STATS */
226 #ifdef USE_DST_BLACKLIST
227 extern int dst_blacklist_init; /* if 0, the dst blacklist is not initialized at startup */
228 extern unsigned int blst_timer_interval; /*blacklist gc timer interval (in s)*/
230 #ifdef USE_DST_BLACKLIST_STATS
231 struct t_dst_blacklist_stats{
232 unsigned long bkl_hit_cnt;
233 unsigned long bkl_lru_cnt;
235 extern struct t_dst_blacklist_stats* dst_blacklist_stats;
236 #endif /* USE_DST_BLACKLIST_STATS */