• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Data Structures
  • Files
  • Directories
  • File List
  • Globals

globals.h

00001 /*
00002  * $Id$
00003  *
00004  * global variables
00005  *
00006  *
00007  * Copyright (C) 2001-2003 FhG Fokus
00008  *
00009  * This file is part of ser, a free SIP server.
00010  *
00011  * ser is free software; you can redistribute it and/or modify
00012  * it under the terms of the GNU General Public License as published by
00013  * the Free Software Foundation; either version 2 of the License, or
00014  * (at your option) any later version
00015  *
00016  * For a license to use the ser software under conditions
00017  * other than those described here, or to purchase support for this
00018  * software, please contact iptel.org by e-mail at the following addresses:
00019  *    info@iptel.org
00020  *
00021  * ser is distributed in the hope that it will be useful,
00022  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00023  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00024  * GNU General Public License for more details.
00025  *
00026  * You should have received a copy of the GNU General Public License
00027  * along with this program; if not, write to the Free Software
00028  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00029  */
00030 
00031 
00032 
00033 #ifndef globals_h
00034 #define globals_h
00035 
00036 #include "types.h"
00037 #include "ip_addr.h"
00038 #include "str.h"
00039 #include "poll_types.h"
00040 
00041 #define NO_DNS     0
00042 #define DO_DNS     1
00043 #define DO_REV_DNS 2
00044 
00045 
00046 extern char* mods_dir;   /* directory with dyn. loadable modules */
00047 extern char* cfg_file;
00048 extern int config_check;
00049 extern char* stat_file;
00050 extern unsigned short port_no;
00051 
00052 extern time_t up_since;
00053 extern pid_t creator_pid;  /* pid of first process before daemonization */
00054 extern int uid;
00055 extern int gid;
00056 extern char* pid_file;
00057 extern char* pgid_file;
00058 extern int own_pgid; /* whether or not we have our own pgid (and it's ok to use kill(0, sig) */
00059 
00060 extern int server_id; /* A unique ID of the SIP server */
00061 
00062 extern struct socket_info* bind_address; /* pointer to the crt. proc.
00063                                                                                         listening address */
00064 extern struct socket_info* sendipv4; /* ipv4 socket to use when msg.
00065                                                                                 comes from ipv6*/
00066 extern struct socket_info* sendipv6; /* same as above for ipv6 */
00067 #ifdef USE_RAW_SOCKS
00068 extern int raw_udp4_send_sock;
00069 #endif /* USE_RAW_SOCKS */
00070 
00071 #ifdef USE_TCP
00072 extern struct socket_info* sendipv4_tcp; /* ipv4 socket to use when msg.
00073                                                                                 comes from ipv6*/
00074 extern struct socket_info* sendipv6_tcp; /* same as above for ipv6 */
00075 extern int unix_tcp_sock; /* socket used for communication with tcp main*/
00076 #endif
00077 #ifdef USE_TLS
00078 extern struct socket_info* sendipv4_tls; /* ipv4 socket to use when msg.
00079                                                                                 comes from ipv6*/
00080 extern struct socket_info* sendipv6_tls; /* same as above for ipv6 */
00081 #endif
00082 #ifdef USE_SCTP
00083 extern struct socket_info* sendipv4_sctp; /* ipv4 socket to use when msg.
00084                                                                                 comes from ipv6*/
00085 extern struct socket_info* sendipv6_sctp; /* same as above for ipv6 */
00086 #endif
00087 
00088 extern unsigned int maxbuffer;
00089 extern unsigned int sql_buffer_size;
00090 extern int children_no;
00091 extern int socket_workers;
00092 #ifdef USE_TCP
00093 extern int tcp_main_pid;
00094 extern int tcp_cfg_children_no;
00095 extern int tcp_children_no;
00096 extern int tcp_disable;
00097 extern enum poll_types tcp_poll_method;
00098 extern int tcp_max_connections; /* maximum tcp connections, hard limit */
00099 extern int tls_max_connections; /* maximum tls connections, hard limit */
00100 #endif
00101 #ifdef USE_TLS
00102 extern int tls_disable;
00103 extern unsigned short tls_port_no;
00104 #endif
00105 #ifdef USE_SCTP
00106 extern int sctp_disable;
00107 extern int sctp_children_no;
00108 #endif
00109 extern int dont_fork;
00110 extern int dont_daemonize;
00111 extern int check_via;
00112 extern int phone2tel;
00113 extern int received_dns;
00114 extern int syn_branch;
00115 /* extern int process_no; */
00116 extern int child_rank;
00117 extern int sip_warning;
00118 extern int server_signature;
00119 extern str server_hdr;
00120 extern str user_agent_hdr;
00121 extern char* user;
00122 extern char* group;
00123 extern char* sock_user;
00124 extern char* sock_group;
00125 extern int sock_uid;
00126 extern int sock_gid;
00127 extern int sock_mode;
00128 extern char* chroot_dir;
00129 extern char* working_dir;
00130 extern int sr_auto_aliases;
00131 extern int sr_msg_time;
00132 
00133 #ifdef USE_MCAST
00134 extern int mcast_loopback;
00135 extern int mcast_ttl;
00136 #endif /* USE_MCAST */
00137 
00138 #ifdef USE_STUN
00139 extern unsigned int stun_refresh_interval;
00140 extern int stun_allow_stun;
00141 extern int stun_allow_fp;
00142 #endif
00143 
00144 #ifdef USE_IPV6
00145 extern int auto_bind_ipv6;
00146 #endif
00147 
00148 extern int tos;
00149 extern int pmtu_discovery;
00150 
00151 /*
00152  * debug & log_stderr moved to dprint.h*/
00153 
00154 /* extern process_bm_t process_bit; */
00155 /* extern int *pids; -moved to pt.h */
00156 
00157 extern int cfg_errors;
00158 extern int cfg_warnings;
00159 extern unsigned int msg_no;
00160 
00161 extern unsigned long shm_mem_size;
00162 extern unsigned long pkg_mem_size;
00163 
00164 /* AVP configuration */
00165 extern char *avp_db_url;  /* db url used by user preferences (AVPs) */
00166 
00167 /* moved to pt.h
00168 extern int *pids;
00169 extern int process_no;
00170 */
00171 
00172 extern int reply_to_via;
00173 
00174 extern int is_main;
00175 extern int fixup_complete;
00176 
00177 /* debugging level for dumping memory status */
00178 extern int memlog;
00179 /* debugging level for malloc debugging messages */
00180 extern int memdbg;
00181 
00182 /* debugging level for timer debugging (see -DTIMER_DEBUG) */
00183 extern int timerlog;
00184 
00185 /* looking up outbound interface ? */
00186 extern int mhomed;
00187 
00188 /* command-line arguments */
00189 extern int my_argc;
00190 extern char **my_argv;
00191 
00192 /* pre-set addresses */
00193 extern str default_global_address;
00194 /* pre-ser ports */
00195 extern str default_global_port;
00196 
00197 /* how much time to allow for shutdown, before killing everything */
00198 extern int ser_kill_timeout;
00199 
00200 /* core dump and file limits */
00201 extern int disable_core_dump;
00202 extern int open_files_limit;
00203 
00204 /* memory lock/pre-fault */
00205 extern int shm_force_alloc;
00206 extern int mlock_pages;
00207 
00208 /* real time stuff */
00209 extern int real_time;
00210 extern int rt_prio;
00211 extern int rt_policy; /* SCHED_OTHER */
00212 extern int rt_timer1_prio;  /* "fast" timer */
00213 extern int rt_timer2_prio;  /* "slow" timer */
00214 extern int rt_timer1_policy; /* "fast" timer, SCHED_OTHER */
00215 extern int rt_timer2_policy; /* "slow" timer, SCHED_OTHER */
00216 
00217 extern int http_reply_hack;
00218 
00219 #ifdef USE_DNS_CACHE
00220 extern int dns_cache_init; /* if 0, the DNS cache is not initialized at startup */
00221 extern unsigned int dns_timer_interval; /* gc timer interval in s */
00222 extern int dns_flags; /* default flags used for the  dns_*resolvehost
00223                     (compatibility wrappers) */
00224 
00225 #ifdef USE_DNS_CACHE_STATS
00226 struct t_dns_cache_stats{
00227         unsigned long dns_req_cnt;
00228         unsigned long dc_hits_cnt;
00229         unsigned long dc_neg_hits_cnt;
00230         unsigned long dc_lru_cnt;
00231 };
00232 extern struct t_dns_cache_stats* dns_cache_stats;
00233 #endif /* USE_DNS_CACHE_STATS */
00234 #endif
00235 #ifdef USE_DST_BLACKLIST
00236 extern int dst_blacklist_init; /* if 0, the dst blacklist is not initialized at startup */
00237 extern unsigned int blst_timer_interval; /*blacklist gc timer interval (in s)*/
00238 
00239 #ifdef USE_DST_BLACKLIST_STATS
00240 struct t_dst_blacklist_stats{
00241         unsigned long bkl_hit_cnt;
00242         unsigned long bkl_lru_cnt;
00243 };
00244 extern struct t_dst_blacklist_stats* dst_blacklist_stats;
00245 #endif /* USE_DST_BLACKLIST_STATS */
00246 #endif
00247 
00248 #endif

Generated on Tue May 22 2012 13:10:07 for SIP Router by  doxygen 1.7.1