/* $Id$ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono * * This program 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. * * This program 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. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __PJNATH_CONFIG_H__ #define __PJNATH_CONFIG_H__ /** * @file config.h * @brief Compile time settings */ #include /** * @defgroup PJNATH_CONFIG Configuration * @brief Various compile time settings * @{ */ /* ************************************************************************** * GENERAL */ /** * The log level for PJNATH error display. * * default 1 */ #ifndef PJNATH_ERROR_LEVEL # define PJNATH_ERROR_LEVEL 1 #endif /* ************************************************************************** * STUN CONFIGURATION */ /** * Maximum number of attributes in the STUN packet (for the new STUN * library). * * Default: 16 */ #ifndef PJ_STUN_MAX_ATTR # define PJ_STUN_MAX_ATTR 16 #endif /** * The default initial STUN round-trip time estimation (the RTO value * in RFC 3489-bis), in miliseconds. * This value is used to control the STUN request * retransmit time. The initial value of retransmission interval * would be set to this value, and will be doubled after each * retransmission. */ #ifndef PJ_STUN_RTO_VALUE # define PJ_STUN_RTO_VALUE 100 #endif /** * The STUN transaction timeout value, in miliseconds. * After the last retransmission is sent and if no response is received * after this time, the STUN transaction will be considered to have failed. * * The default value is 16x RTO (as per RFC 3489-bis). */ #ifndef PJ_STUN_TIMEOUT_VALUE # define PJ_STUN_TIMEOUT_VALUE (16 * PJ_STUN_RTO_VALUE) #endif /** * Maximum number of STUN transmission count. * * Default: 7 (as per RFC 3489-bis) */ #ifndef PJ_STUN_MAX_TRANSMIT_COUNT # define PJ_STUN_MAX_TRANSMIT_COUNT 7 #endif /** * Duration to keep response in the cache, in msec. * * Default: 10000 (as per RFC 3489-bis) */ #ifndef PJ_STUN_RES_CACHE_DURATION # define PJ_STUN_RES_CACHE_DURATION 10000 #endif /** * Maximum size of STUN message. */ #ifndef PJ_STUN_MAX_PKT_LEN # define PJ_STUN_MAX_PKT_LEN 800 #endif /** * Default STUN port as defined by RFC 3489. */ #define PJ_STUN_PORT 3478 /** * Padding character for string attributes. * * Default: ASCII 0 */ #ifndef PJ_STUN_STRING_ATTR_PAD_CHR # define PJ_STUN_STRING_ATTR_PAD_CHR 0 #endif /** * Enable pre-RFC3489bis-07 style of STUN MESSAGE-INTEGRITY and FINGERPRINT * calculation. By default this should be disabled since the calculation is * not backward compatible with current STUN specification. */ #ifndef PJ_STUN_OLD_STYLE_MI_FINGERPRINT # define PJ_STUN_OLD_STYLE_MI_FINGERPRINT 0 #endif /* ************************************************************************** * STUN TRANSPORT CONFIGURATION */ /** * The packet buffer size for the STUN transport. */ #ifndef PJ_STUN_SOCK_PKT_LEN # define PJ_STUN_SOCK_PKT_LEN 2000 #endif /** * The duration of the STUN keep-alive period, in seconds. */ #ifndef PJ_STUN_KEEP_ALIVE_SEC # define PJ_STUN_KEEP_ALIVE_SEC 15 #endif /* ************************************************************************** * TURN CONFIGURATION */ /** * Maximum DNS SRV entries to be processed in the DNS SRV response */ #ifndef PJ_TURN_MAX_DNS_SRV_CNT # define PJ_TURN_MAX_DNS_SRV_CNT 4 #endif /** * Maximum TURN packet size to be supported. */ #ifndef PJ_TURN_MAX_PKT_LEN # define PJ_TURN_MAX_PKT_LEN 3000 #endif /** * The TURN permission lifetime setting. This value should be taken from the * TURN protocol specification. */ #ifndef PJ_TURN_PERM_TIMEOUT # define PJ_TURN_PERM_TIMEOUT 300 #endif /** * The TURN channel binding lifetime. This value should be taken from the * TURN protocol specification. */ #ifndef PJ_TURN_CHANNEL_TIMEOUT # define PJ_TURN_CHANNEL_TIMEOUT 600 #endif /** * Number of seconds to refresh the permission/channel binding before the * permission/channel binding expires. This value should be greater than * PJ_TURN_PERM_TIMEOUT setting. */ #ifndef PJ_TURN_REFRESH_SEC_BEFORE # define PJ_TURN_REFRESH_SEC_BEFORE 60 #endif /** * The TURN session timer heart beat interval. When this timer occurs, the * TURN session will scan all the permissions/channel bindings to see which * need to be refreshed. */ #ifndef PJ_TURN_KEEP_ALIVE_SEC # define PJ_TURN_KEEP_ALIVE_SEC 15 #endif /* ************************************************************************** * ICE CONFIGURATION */ /** * Maximum number of ICE candidates. * * Default: 16 */ #ifndef PJ_ICE_MAX_CAND # define PJ_ICE_MAX_CAND 16 #endif /** * Maximum number of candidates for each ICE stream transport component. * * Default: 8 */ #ifndef PJ_ICE_ST_MAX_CAND # define PJ_ICE_ST_MAX_CAND 8 #endif /** * The number of bits to represent component IDs. This will affect * the maximum number of components (PJ_ICE_MAX_COMP) value. */ #ifndef PJ_ICE_COMP_BITS # define PJ_ICE_COMP_BITS 3 #endif /** * Maximum number of ICE components. */ #define PJ_ICE_MAX_COMP (2<