globals.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. /*
  2. * $Id$
  3. *
  4. * global variables
  5. *
  6. *
  7. * Copyright (C) 2001-2003 FhG Fokus
  8. *
  9. * This file is part of ser, a free SIP server.
  10. *
  11. * ser is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License as published by
  13. * the Free Software Foundation; either version 2 of the License, or
  14. * (at your option) any later version
  15. *
  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. * [email protected]
  20. *
  21. * ser is distributed in the hope that it will be useful,
  22. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  23. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  24. * GNU General Public License for more details.
  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
  28. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  29. */
  30. #ifndef globals_h
  31. #define globals_h
  32. #include "types.h"
  33. #include "ip_addr.h"
  34. #include "str.h"
  35. #include "poll_types.h"
  36. #define NO_DNS 0
  37. #define DO_DNS 1
  38. #define DO_REV_DNS 2
  39. extern char * cfg_file;
  40. extern int config_check;
  41. extern char *stat_file;
  42. extern unsigned short port_no;
  43. extern int uid;
  44. extern int gid;
  45. char* pid_file;
  46. char* pgid_file;
  47. extern int own_pgid; /* whether or not we have our own pgid (and it's ok
  48. >--->--->--->--->--->--->--->--->--->--->--- to use kill(0, sig) */
  49. extern struct socket_info* bind_address; /* pointer to the crt. proc.
  50. listening address */
  51. extern struct socket_info* sendipv4; /* ipv4 socket to use when msg.
  52. comes from ipv6*/
  53. extern struct socket_info* sendipv6; /* same as above for ipv6 */
  54. #ifdef USE_TCP
  55. extern struct socket_info* sendipv4_tcp; /* ipv4 socket to use when msg.
  56. comes from ipv6*/
  57. extern struct socket_info* sendipv6_tcp; /* same as above for ipv6 */
  58. extern int unix_tcp_sock; /* socket used for communication with tcp main*/
  59. #endif
  60. #ifdef USE_TLS
  61. extern struct socket_info* sendipv4_tls; /* ipv4 socket to use when msg.
  62. comes from ipv6*/
  63. extern struct socket_info* sendipv6_tls; /* same as above for ipv6 */
  64. #endif
  65. extern unsigned int maxbuffer;
  66. extern int children_no;
  67. #ifdef USE_TCP
  68. extern int tcp_children_no;
  69. extern int tcp_disable;
  70. extern int tcp_accept_aliases;
  71. extern int tcp_connect_timeout;
  72. extern int tcp_send_timeout;
  73. extern enum poll_types tcp_poll_method;
  74. extern int tcp_max_fd_no;
  75. #endif
  76. #ifdef USE_TLS
  77. extern int tls_disable;
  78. extern unsigned short tls_port_no;
  79. #endif
  80. extern int dont_fork;
  81. extern int check_via;
  82. extern int received_dns;
  83. extern int syn_branch;
  84. /* extern int process_no; */
  85. extern int sip_warning;
  86. extern int server_signature;
  87. extern char* user;
  88. extern char* group;
  89. extern char* sock_user;
  90. extern char* sock_group;
  91. extern int sock_uid;
  92. extern int sock_gid;
  93. extern int sock_mode;
  94. extern char* chroot_dir;
  95. extern char* working_dir;
  96. #ifdef USE_MCAST
  97. extern int mcast_loopback;
  98. extern int mcast_ttl;
  99. #endif /* USE_MCAST */
  100. /*
  101. * debug & log_stderr moved to dprint.h*/
  102. /* extern process_bm_t process_bit; */
  103. /* extern int *pids; -moved to pt.h */
  104. extern int cfg_errors;
  105. extern unsigned int msg_no;
  106. extern unsigned long shm_mem_size;
  107. /* FIFO server config */
  108. extern char *fifo; /* FIFO name */
  109. extern int fifo_mode;
  110. extern char *fifo_dir; /* dir. where reply fifos are allowed */
  111. extern char *fifo_db_url; /* db url used by db_fifo interface */
  112. /* UNIX domain socket configuration */
  113. extern char *unixsock_name; /* The name of the socket */
  114. extern int unixsock_children; /* The number of listening children */
  115. extern int unixsock_tx_timeout; /* Timeout (in ms) used when sending data */
  116. /* AVP configuration */
  117. extern char *avp_db_url; /* db url used by user preferences (AVPs) */
  118. /* moved to pt.h
  119. extern int *pids;
  120. extern int process_no;
  121. */
  122. extern int reply_to_via;
  123. extern int is_main;
  124. /* debugging level for dumping memory status */
  125. extern int memlog;
  126. /* looking up outbound interface ? */
  127. extern int mhomed;
  128. /* command-line arguments */
  129. extern int my_argc;
  130. extern char **my_argv;
  131. /* pre-set addresses */
  132. extern str default_global_address;
  133. /* pre-ser ports */
  134. extern str default_global_port;
  135. /* core dump and file limits */
  136. extern int disable_core_dump;
  137. extern int open_files_limit;
  138. #endif