1
/* $Id: config.h 3553 2011-05-05 06:14:19Z nanang $ */
3
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
4
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
#ifndef __PJLIB_UTIL_CONFIG_H__
21
#define __PJLIB_UTIL_CONFIG_H__
26
* @brief Compile time settings
30
* @defgroup PJLIB_UTIL_CONFIG Configuration
31
* @ingroup PJLIB_UTIL_BASE
36
/* **************************************************************************
41
* Maximum number of IP addresses in DNS A response.
43
#ifndef PJ_DNS_MAX_IP_IN_A_REC
44
# define PJ_DNS_MAX_IP_IN_A_REC 8
49
* Maximum server address entries per one SRV record
51
#ifndef PJ_DNS_SRV_MAX_ADDR
52
# define PJ_DNS_SRV_MAX_ADDR 8
57
* This constant specifies the maximum names to keep in the temporary name
58
* table when performing name compression scheme when duplicating DNS packet
59
* (the #pj_dns_packet_dup() function).
61
* Generally name compression is desired, since it saves some memory (see
62
* PJ_DNS_RESOLVER_RES_BUF_SIZE setting). However it comes at the expense of
63
* a little processing overhead to perform name scanning and also a little
64
* bit more stack usage (8 bytes per entry on 32bit platform).
68
#ifndef PJ_DNS_MAX_NAMES_IN_NAMETABLE
69
# define PJ_DNS_MAX_NAMES_IN_NAMETABLE 16
73
/* **************************************************************************
74
* RESOLVER CONFIGURATION
79
* Maximum numbers of DNS nameservers that can be configured in resolver.
81
#ifndef PJ_DNS_RESOLVER_MAX_NS
82
# define PJ_DNS_RESOLVER_MAX_NS 16
87
* Default retransmission delay, in miliseconds. The combination of
88
* retransmission delay and count determines the query timeout.
90
* Default: 2000 (2 seconds, according to RFC 1035)
92
#ifndef PJ_DNS_RESOLVER_QUERY_RETRANSMIT_DELAY
93
# define PJ_DNS_RESOLVER_QUERY_RETRANSMIT_DELAY 2000
98
* Maximum number of transmissions before timeout is declared for
103
#ifndef PJ_DNS_RESOLVER_QUERY_RETRANSMIT_COUNT
104
# define PJ_DNS_RESOLVER_QUERY_RETRANSMIT_COUNT 5
109
* Maximum life-time of DNS response in the resolver response cache,
110
* in seconds. If the value is zero, then DNS response caching will be
113
* Default is 300 seconds (5 minutes).
115
* @see PJ_DNS_RESOLVER_INVALID_TTL
117
#ifndef PJ_DNS_RESOLVER_MAX_TTL
118
# define PJ_DNS_RESOLVER_MAX_TTL (5*60)
122
* The life-time of invalid DNS response in the resolver response cache.
123
* An invalid DNS response is a response which RCODE is non-zero and
124
* response without any answer section. These responses can be put in
125
* the cache too to minimize message round-trip.
127
* Default: 60 (one minute).
129
* @see PJ_DNS_RESOLVER_MAX_TTL
131
#ifndef PJ_DNS_RESOLVER_INVALID_TTL
132
# define PJ_DNS_RESOLVER_INVALID_TTL 60
136
* The interval on which nameservers which are known to be good to be
137
* probed again to determine whether they are still good. Note that
138
* this applies to both active nameserver (the one currently being used)
139
* and idle nameservers (good nameservers that are not currently selected).
140
* The probing to query the "goodness" of nameservers involves sending
141
* the same query to multiple servers, so it's probably not a good idea
142
* to send this probing too often.
144
* Default: 600 (ten minutes)
146
* @see PJ_DNS_RESOLVER_BAD_NS_TTL
148
#ifndef PJ_DNS_RESOLVER_GOOD_NS_TTL
149
# define PJ_DNS_RESOLVER_GOOD_NS_TTL (10*60)
153
* The interval on which nameservers which known to be bad to be probed
154
* again to determine whether it is still bad.
156
* Default: 60 (one minute)
158
* @see PJ_DNS_RESOLVER_GOOD_NS_TTL
160
#ifndef PJ_DNS_RESOLVER_BAD_NS_TTL
161
# define PJ_DNS_RESOLVER_BAD_NS_TTL (1*60)
166
* Maximum size of UDP packet. RFC 1035 states that maximum size of
167
* DNS packet carried over UDP is 512 bytes.
171
#ifndef PJ_DNS_RESOLVER_MAX_UDP_SIZE
172
# define PJ_DNS_RESOLVER_MAX_UDP_SIZE 512
177
* Size of memory pool allocated for each individual DNS response cache.
178
* This value here should be more or less the same as maximum UDP packet
179
* size (PJ_DNS_RESOLVER_MAX_UDP_SIZE), since the DNS replicator function
180
* (#pj_dns_packet_dup()) is also capable of performing name compressions.
184
#ifndef PJ_DNS_RESOLVER_RES_BUF_SIZE
185
# define PJ_DNS_RESOLVER_RES_BUF_SIZE 512
190
* Size of temporary pool buffer for parsing DNS packets in resolver.
194
#ifndef PJ_DNS_RESOLVER_TMP_BUF_SIZE
195
# define PJ_DNS_RESOLVER_TMP_BUF_SIZE 4000
199
/* **************************************************************************
200
* SCANNER CONFIGURATION
205
* Macro PJ_SCANNER_USE_BITWISE is defined and non-zero (by default yes)
206
* will enable the use of bitwise for character input specification (cis).
207
* This would save several kilobytes of .bss memory in the SIP parser.
209
#ifndef PJ_SCANNER_USE_BITWISE
210
# define PJ_SCANNER_USE_BITWISE 1
215
/* **************************************************************************
216
* STUN CLIENT CONFIGURATION
220
* Maximum number of attributes in the STUN packet (for the old STUN
225
#ifndef PJSTUN_MAX_ATTR
226
# define PJSTUN_MAX_ATTR 16
231
* Maximum number of attributes in the STUN packet (for the new STUN
236
#ifndef PJ_STUN_MAX_ATTR
237
# define PJ_STUN_MAX_ATTR 16
241
/* **************************************************************************
246
* Specifies whether CRC32 algorithm should use the table based lookup table
247
* for faster calculation, at the expense of about 1KB table size on the
248
* executable. If zero, the CRC32 will use non-table based which is more than
249
* an order of magnitude slower.
253
#ifndef PJ_CRC32_HAS_TABLES
254
# define PJ_CRC32_HAS_TABLES 1
258
/* **************************************************************************
259
* HTTP Client configuration
262
* Timeout value for HTTP request operation. The value is in ms.
265
#ifndef PJ_HTTP_DEFAULT_TIMEOUT
266
# define PJ_HTTP_DEFAULT_TIMEOUT (60000)
273
#endif /* __PJLIB_UTIL_CONFIG_H__ */