OSDN Git Service

Add MS7619SE
[uclinux-h8/uClinux-dist.git] / user / ser / config.h
1 /*
2  *  $Id: config.h,v 1.61.2.2 2005/11/29 19:39:45 andrei Exp $
3  *
4  * Copyright (C) 2001-2003 FhG Fokus
5  *
6  * This file is part of ser, a free SIP server.
7  *
8  * ser is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version
12  *
13  * For a license to use the ser software under conditions
14  * other than those described here, or to purchase support for this
15  * software, please contact iptel.org by e-mail at the following addresses:
16  *    info@iptel.org
17  *
18  * ser is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License 
24  * along with this program; if not, write to the Free Software 
25  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
26  *
27  * History:
28  * --------
29  * 2003-04-05  DEFAULT_*_URL introduced (jiri)
30  * 2003-07-04  fixed SRV lookup prefix for TLS/sips (andrei)
31  * 2005-04-25  MAX_BRANCH_PARAM_LEN too small, fixed (andrei)
32  */
33
34
35
36
37 #ifndef config_h
38 #define config_h
39
40 #include "types.h"
41
42 /* default sip port if none specified */
43 #define SIP_PORT  5060
44 #define SIPS_PORT 5061
45
46 #define CFG_FILE CFG_DIR "ser.cfg"
47
48 #define TLS_PKEY_FILE CFG_DIR "cert.pem" 
49 #define TLS_CERT_FILE CFG_DIR "cert.pem"
50 #define TLS_CA_FILE 0 /* no CA list file by default */
51
52
53 /* maximum number of addresses on which we will listen */
54 #define MAX_LISTEN 16
55
56 /* default number of child processes started */
57 #define CHILD_NO    8
58
59 #define RT_NO 20 /* routing tables number */
60 #define FAILURE_RT_NO RT_NO /* on_failure routing tables number */
61 #define ONREPLY_RT_NO RT_NO /* on_reply routing tables number */
62 #define DEFAULT_RT 0 /* default routing table */
63
64 #define MAX_REC_LEV 100 /* maximum number of recursive calls */
65 #define ROUTE_MAX_REC_LEV 100 /* maximum number of recursive calls
66                                                            for route()*/
67
68 #define MAX_URI_SIZE 1024       /* used when rewriting URIs */
69
70 #define MY_VIA "Via: SIP/2.0/UDP "
71 #define MY_VIA_LEN (sizeof(MY_VIA) - 1)
72
73 #define CONTENT_LENGTH "Content-Length: "
74 #define CONTENT_LENGTH_LEN (sizeof(CONTENT_LENGTH)-1)
75
76 #define USER_AGENT "User-Agent: Sip EXpress router"\
77                 "(" VERSION " (" ARCH "/" OS"))"
78 #define USER_AGENT_LEN (sizeof(USER_AGENT)-1)
79
80 #define SERVER_HDR "Server: Sip EXpress router "\
81                 "(" VERSION " (" ARCH "/" OS"))"
82 #define SERVER_HDR_LEN (sizeof(SERVER_HDR)-1)
83
84 #define MAX_WARNING_LEN  256
85                 
86 #define MY_BRANCH ";branch="
87 #define MY_BRANCH_LEN (sizeof(MY_BRANCH) - 1)
88
89 #define MAX_PORT_LEN 7 /* ':' + max 5 letters + \0 */
90 #define CRLF "\r\n"
91 #define CRLF_LEN (sizeof(CRLF) - 1)
92
93 #define RECEIVED        ";received="
94 #define RECEIVED_LEN (sizeof(RECEIVED) - 1)
95
96 #define TRANSPORT_PARAM ";transport="
97 #define TRANSPORT_PARAM_LEN (sizeof(TRANSPORT_PARAM) - 1)
98
99 #define TOTAG_TOKEN ";tag="
100 #define TOTAG_TOKEN_LEN (sizeof(TOTAG_TOKEN)-1)
101
102 #define RPORT ";rport="
103 #define RPORT_LEN (sizeof(RPORT) - 1)
104
105 #define ID_PARAM ";i="
106 #define ID_PARAM_LEN (sizeof(ID_PARAM) - 1)
107
108 #define SRV_UDP_PREFIX "_sip._udp."
109 #define SRV_UDP_PREFIX_LEN (sizeof(SRV_UDP_PREFIX) - 1)
110
111 #define SRV_TCP_PREFIX "_sip._tcp."
112 #define SRV_TCP_PREFIX_LEN (sizeof(SRV_TCP_PREFIX) - 1)
113
114 #define SRV_TLS_PREFIX "_sips._tcp."
115 #define SRV_TLS_PREFIX_LEN (sizeof(SRV_TLS_PREFIX) - 1)
116
117 #define SRV_MAX_PREFIX_LEN SRV_TLS_PREFIX_LEN
118
119 /*used only if PKG_MALLOC is defined*/
120 #define PKG_MEM_POOL_SIZE 1024*1024
121
122 /*used if SH_MEM is defined*/
123 #define SHM_MEM_SIZE 32
124
125 #define TIMER_TICK 1
126
127 /* dimensioning buckets in q_malloc */
128 /* size of the size2bucket table; everything beyond that asks for
129    a variable-size kilo-bucket
130  */
131 #define MAX_FIXED_BLOCK         3072
132 /* distance of kilo-buckets */
133 #define BLOCK_STEP                      512
134 /* maximum number of possible buckets */
135 #define MAX_BUCKET              15
136
137 /* receive buffer size -- preferably set low to
138    avoid terror of excessively huge messages; they are
139    useless anyway
140 */
141 #define BUF_SIZE 65535
142
143 /* forwarding  -- Via buffer dimensioning */
144 #define MAX_VIA_LINE_SIZE       240
145 #define MAX_RECEIVED_SIZE       57
146 #define MAX_RPORT_SIZE          13
147
148 /* maximum number of branches per transaction */
149 #define MAX_BRANCHES    12
150
151 /* maximum length of a FIFO server command */
152 #define MAX_FIFO_COMMAND 512
153
154 /* buffer dimensions for FIFO server */
155 #define MAX_CONSUME_BUFFER 1024
156 /* where reply pipes may be opened */
157 #define DEFAULT_FIFO_DIR "/tmp/"
158 /* max length of the text of fifo 'print' command */
159 #define MAX_PRINT_TEXT 256
160
161 /* maximum length of Contact header field in redirection replies */
162 #define MAX_REDIRECTION_LEN 512
163
164 /* used by FIFO statistics in module to terminate line;
165    extra whitespaces are used to overwrite remainders of
166    previous line if longer than current one
167 */
168 #define CLEANUP_EOL "      \n"
169
170 /* how patient is ser with FIFO clients not awaiting a reply? 
171         4 x 80ms = 0.32 sec
172 */
173 #define FIFO_REPLY_RETRIES      4
174 #define FIFO_REPLY_WAIT         80000
175
176 /* magic cookie for transaction matching as defined in RFC3261 */
177 #define MCOOKIE "z9hG4bK"
178 #define MCOOKIE_LEN (sizeof(MCOOKIE)-1)
179 /* Maximum length of values appended to Via-branch parameter */
180 #define MAX_BRANCH_PARAM_LEN  (MCOOKIE_LEN+8 /*int2hex*/ + 1 /*sep*/ + \
181                                                                 MD5_LEN /* max(int2hex, MD5_LEN) */ \
182                                                                 + 1 /*sep*/ + 8 /*int2hex*/ + \
183                                                                 1 /*extra space, needed by t_calc_branch*/)
184
185
186 /* maximum path length */
187 #define PATH_MAX_GUESS  1024
188
189 #define DEFAULT_DB_URL "mysql://ser:heslo@localhost/ser"
190 #define DEFAULT_DB_URL_LEN (sizeof(DEFAULT_DB_URL) - 1)
191
192 #define DEFAULT_RODB_URL "mysql://serro:47serro11@localhost/ser"
193 #define DEFAULT_RODB_URL_LEN (sizeof(DEFAULT_RODB_URL) - 1)
194
195 /* table holding versions of other ser tables */
196 #define VERSION_TABLE "version"
197 #define VERSION_COLUMN "table_version"
198 #define TABLENAME_COLUMN "table_name"
199
200 /* minimum packet size; smaller packets will be dropped silently */
201 #define MIN_UDP_PACKET        32
202
203
204
205 #endif