globals.h
1b1b19d8
 /*
4bd1673d
  * $Id$
1b1b19d8
  *
  * global variables
  *
7dd0b342
  *
53c7e0f1
  * Copyright (C) 2001-2003 FhG Fokus
7dd0b342
  *
  * This file is part of ser, a free SIP server.
  *
  * ser is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version
  *
  * For a license to use the ser software under conditions
  * other than those described here, or to purchase support for this
  * software, please contact iptel.org by e-mail at the following addresses:
  *    info@iptel.org
  *
  * ser is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
021e7e0e
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
7dd0b342
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
1b1b19d8
  */
 
 
7dd0b342
 
1b1b19d8
 #ifndef globals_h
 #define globals_h
 
4bd1673d
 #include "types.h"
4e2fdd79
 #include "ip_addr.h"
36ef0329
 #include "str.h"
0ba367ec
 #include "poll_types.h"
4bd1673d
 
1b1b19d8
 #define NO_DNS     0
 #define DO_DNS     1
 #define DO_REV_DNS 2
 
 
f4194f69
 extern char* mods_dir;   /* directory with dyn. loadable modules */
 extern char* cfg_file;
dda578ba
 extern int config_check;
f4194f69
 extern char* stat_file;
1b1b19d8
 extern unsigned short port_no;
19710544
 
78a65d14
 extern time_t up_since;
02f62296
 extern pid_t creator_pid;  /* pid of first process before daemonization */
c03cc017
 extern int uid;
 extern int gid;
35bbe4d0
 extern char* pid_file;
 extern char* pgid_file;
 extern int own_pgid; /* whether or not we have our own pgid (and it's ok to use kill(0, sig) */
c03cc017
 
89fde575
 extern int server_id; /* A unique ID of the SIP server */
 
e3fc93f4
 extern struct socket_info* bind_address; /* pointer to the crt. proc.
 											listening address */
 extern struct socket_info* sendipv4; /* ipv4 socket to use when msg.
 										comes from ipv6*/
36ef0329
 extern struct socket_info* sendipv6; /* same as above for ipv6 */
1db67b92
 #ifdef USE_RAW_SOCKS
 extern int raw_udp4_send_sock;
 #endif /* USE_RAW_SOCKS */
 
0c5da34b
 #ifdef USE_TCP
f2f969dd
 extern struct socket_info* sendipv4_tcp; /* ipv4 socket to use when msg.
 										comes from ipv6*/
 extern struct socket_info* sendipv6_tcp; /* same as above for ipv6 */
0c5da34b
 extern int unix_tcp_sock; /* socket used for communication with tcp main*/
 #endif
e9b02e8e
 #ifdef USE_TLS
 extern struct socket_info* sendipv4_tls; /* ipv4 socket to use when msg.
 										comes from ipv6*/
 extern struct socket_info* sendipv6_tls; /* same as above for ipv6 */
 #endif
ed990c31
 #ifdef USE_SCTP
 extern struct socket_info* sendipv4_sctp; /* ipv4 socket to use when msg.
 										comes from ipv6*/
 extern struct socket_info* sendipv6_sctp; /* same as above for ipv6 */
 #endif
0c5da34b
 
36ef0329
 extern unsigned int maxbuffer;
5cd87175
 extern unsigned int sql_buffer_size;
7268726e
 extern int children_no;
5b532c7f
 #ifdef USE_TCP
f2e1aa50
 extern int tcp_main_pid;
5b532c7f
 extern int tcp_children_no;
5dcfb23d
 extern int tcp_disable;
0ba367ec
 extern enum poll_types tcp_poll_method;
3dc4f620
 extern int tcp_max_connections; /* maximum connections, hard limit */
5b532c7f
 #endif
28427aa4
 #ifdef USE_TLS
 extern int tls_disable;
057f0454
 extern unsigned short tls_port_no;
28427aa4
 #endif
ed990c31
 #ifdef USE_SCTP
 extern int sctp_disable;
 extern int sctp_children_no;
 #endif
1b1b19d8
 extern int dont_fork;
bc404f2b
 extern int dont_daemonize;
1b1b19d8
 extern int check_via;
face488e
 extern int phone2tel;
1b1b19d8
 extern int received_dns;
caf80ae6
 extern int syn_branch;
d9e14035
 /* extern int process_no; */
3167c744
 extern int child_rank;
caf80ae6
 extern int sip_warning;
 extern int server_signature;
c745469f
 extern str server_hdr;
 extern str user_agent_hdr;
054cb6cf
 extern char* user;
 extern char* group;
71fd3ebd
 extern char* sock_user;
 extern char* sock_group;
 extern int sock_uid;
 extern int sock_gid;
 extern int sock_mode;
3e8c3475
 extern char* chroot_dir;
 extern char* working_dir;
bb4cd6b0
 extern int sr_auto_aliases;
3e8c3475
 
2ba73117
 #ifdef USE_MCAST
 extern int mcast_loopback;
956d111a
 extern int mcast_ttl;
2ba73117
 #endif /* USE_MCAST */
 
96227c65
 #ifdef USE_STUN
 extern unsigned int stun_refresh_interval;
 extern int stun_allow_stun;
 extern int stun_allow_fp;
 #endif
 
fe09f315
 extern int tos;
f3a26797
 extern int pmtu_discovery;
fe09f315
 
4e2fdd79
 /*
  * debug & log_stderr moved to dprint.h*/
4bd1673d
 
a76545c8
 /* extern process_bm_t process_bit; */
d9e14035
 /* extern int *pids; -moved to pt.h */
1b1b19d8
 
63fa628f
 extern int cfg_errors;
dcb59e67
 extern int cfg_warnings;
e72b5b50
 extern unsigned int msg_no;
1b1b19d8
 
c082177a
 extern unsigned long shm_mem_size;
7b3a6eca
 extern unsigned long pkg_mem_size;
40a8d9dd
 
1580c821
 /* AVP configuration */
 extern char *avp_db_url;  /* db url used by user preferences (AVPs) */
 
d9e14035
 /* moved to pt.h
caf80ae6
 extern int *pids;
 extern int process_no;
d9e14035
 */
caf80ae6
 
 extern int reply_to_via;
 
71bb231e
 extern int is_main;
b0123c36
 extern int fixup_complete;
71bb231e
 
609ada42
 /* debugging level for dumping memory status */
 extern int memlog;
58d0d1b5
 /* debugging level for malloc debugging messages */
 extern int memdbg;
609ada42
 
af93cbdf
 /* debugging level for timer debugging (see -DTIMER_DEBUG) */
 extern int timerlog;
 
2d4b798e
 /* looking up outbound interface ? */
 extern int mhomed;
 
049f64c2
 /* command-line arguments */
 extern int my_argc;
 extern char **my_argv;
 
6bfaa042
 /* pre-set addresses */
 extern str default_global_address;
 /* pre-ser ports */
 extern str default_global_port;
 
96d09107
 /* how much time to allow for shutdown, before killing everything */
8390f722
 extern int ser_kill_timeout;
96d09107
 
385c63eb
 /* core dump and file limits */
 extern int disable_core_dump;
 extern int open_files_limit;
 
8390f722
 /* memory lock/pre-fault */
 extern int shm_force_alloc;
 extern int mlock_pages;
 
 /* real time stuff */
021e7e0e
 extern int real_time;
8390f722
 extern int rt_prio;
 extern int rt_policy; /* SCHED_OTHER */
 extern int rt_timer1_prio;  /* "fast" timer */
 extern int rt_timer2_prio;  /* "slow" timer */
 extern int rt_timer1_policy; /* "fast" timer, SCHED_OTHER */
 extern int rt_timer2_policy; /* "slow" timer, SCHED_OTHER */
 
 
dcb59e67
 #ifdef USE_DNS_CACHE
7905e2d6
 extern int dns_cache_init; /* if 0, the DNS cache is not initialized at startup */
8390f722
 extern unsigned int dns_timer_interval; /* gc timer interval in s */
021e7e0e
 extern int dns_flags; /* default flags used for the  dns_*resolvehost
dcb59e67
                     (compatibility wrappers) */
dd4ffbb7
 
021e7e0e
 #ifdef USE_DNS_CACHE_STATS
 struct t_dns_cache_stats{
 	unsigned long dns_req_cnt;
 	unsigned long dc_hits_cnt;
 	unsigned long dc_neg_hits_cnt;
 	unsigned long dc_lru_cnt;
 };
 extern struct t_dns_cache_stats* dns_cache_stats;
 #endif /* USE_DNS_CACHE_STATS */
dcb59e67
 #endif
 #ifdef USE_DST_BLACKLIST
7905e2d6
 extern int dst_blacklist_init; /* if 0, the dst blacklist is not initialized at startup */
8390f722
 extern unsigned int blst_timer_interval; /*blacklist gc timer interval (in s)*/
021e7e0e
 
 #ifdef USE_DST_BLACKLIST_STATS
 struct t_dst_blacklist_stats{
 	unsigned long bkl_hit_cnt;
 	unsigned long bkl_lru_cnt;
 };
 extern struct t_dst_blacklist_stats* dst_blacklist_stats;
 #endif /* USE_DST_BLACKLIST_STATS */
dcb59e67
 #endif
878fc194
 
1b1b19d8
 #endif