diff --git a/ChangeLog b/ChangeLog index 478ab561..e5b87590 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +05/25/2014 Oleg Moskalenko +Version 4.0.1.1 'Threetrees': + - Bandwidth draft implemented. + 05/18/2014 Oleg Moskalenko Version 4.0.0.2 'Threetrees': - Code cleaning. diff --git a/README.turnserver b/README.turnserver index a62f008a..fbc0efe7 100644 --- a/README.turnserver +++ b/README.turnserver @@ -377,6 +377,11 @@ Options with required values: that limit will be dropped or temporary suppressed (within the available buffer limits). This option can also be set through the database, for a particular realm. + +-B, --bps-capacity Maximum server capacity. + Total bytes-per-second bandwidth the TURN server is allowed to allocate + for the sessions, combined (input and output network streams are treated + separately). --static-auth-secret Static authentication secret value (a string) for TURN REST API only. If not set, then the turn server will try to use the dynamic value diff --git a/examples/etc/turnserver.conf b/examples/etc/turnserver.conf index 07fdfb32..5cf7f7c1 100644 --- a/examples/etc/turnserver.conf +++ b/examples/etc/turnserver.conf @@ -312,6 +312,13 @@ # #max-bps=0 +# +# Maximum server capacity. +# Total bytes-per-second bandwidth the TURN server is allowed to allocate +# for the sessions, combined (input and output network streams are treated separately). +# +# bps-capacity=0 + # Uncomment if no UDP client listener is desired. # By default UDP client listener is always started. # diff --git a/man/man1/turnadmin.1 b/man/man1/turnadmin.1 index fbdac452..4151f845 100644 --- a/man/man1/turnadmin.1 +++ b/man/man1/turnadmin.1 @@ -1,5 +1,5 @@ .\" Text automatically generated by txt2man -.TH TURN 1 "23 April 2014" "" "" +.TH TURN 1 "26 May 2014" "" "" .SH GENERAL INFORMATION \fIturnadmin\fP is a TURN administration tool. This tool can be used to manage diff --git a/man/man1/turnserver.1 b/man/man1/turnserver.1 index 14008819..ba47a972 100644 --- a/man/man1/turnserver.1 +++ b/man/man1/turnserver.1 @@ -1,5 +1,5 @@ .\" Text automatically generated by txt2man -.TH TURN 1 "23 April 2014" "" "" +.TH TURN 1 "26 May 2014" "" "" .SH GENERAL INFORMATION The \fBTURN Server\fP project contains the source code of a TURN server and TURN client @@ -559,6 +559,13 @@ available buffer limits). This option can also be set through the database, for a particular realm. .TP .B +\fB\-B\fP, \fB\-\-bps\-capacity\fP +Maximum server capacity. +Total bytes\-per\-second bandwidth the TURN server is allowed to allocate +for the sessions, combined (input and output network streams are treated +separately). +.TP +.B \fB\-\-static\-auth\-secret\fP Static authentication secret value (a string) for TURN REST API only. If not set, then the turn server will try to use the dynamic value diff --git a/man/man1/turnutils.1 b/man/man1/turnutils.1 index f72b9e68..20a72357 100644 --- a/man/man1/turnutils.1 +++ b/man/man1/turnutils.1 @@ -1,5 +1,5 @@ .\" Text automatically generated by txt2man -.TH TURN 1 "23 April 2014" "" "" +.TH TURN 1 "26 May 2014" "" "" .SH GENERAL INFORMATION A set of turnutils_* programs provides some utility functionality to be used diff --git a/rpm/build.settings.sh b/rpm/build.settings.sh index c75808eb..11e7ee82 100755 --- a/rpm/build.settings.sh +++ b/rpm/build.settings.sh @@ -2,7 +2,7 @@ # Common settings script. -TURNVERSION=4.0.0.2 +TURNVERSION=4.0.1.1 BUILDDIR=~/rpmbuild ARCH=`uname -p` TURNSERVER_SVN_URL=http://coturn.googlecode.com/svn diff --git a/rpm/turnserver.spec b/rpm/turnserver.spec index fe0d9fb0..c9e0d5f9 100644 --- a/rpm/turnserver.spec +++ b/rpm/turnserver.spec @@ -1,5 +1,5 @@ Name: turnserver -Version: 4.0.0.2 +Version: 4.0.1.1 Release: 0%{dist} Summary: Coturn TURN Server @@ -289,6 +289,8 @@ fi %{_includedir}/turn/client/TurnMsgLib.h %changelog +* Sun May 25 2014 Oleg Moskalenko + - Sync to 4.0.1.1 * Sun May 18 2014 Oleg Moskalenko - Sync to 4.0.0.2 * Wed May 07 2014 Oleg Moskalenko diff --git a/src/apps/relay/mainrelay.c b/src/apps/relay/mainrelay.c index 7a5ba894..2cc79011 100644 --- a/src/apps/relay/mainrelay.c +++ b/src/apps/relay/mainrelay.c @@ -92,7 +92,7 @@ LOW_DEFAULT_PORTS_BOUNDARY,HIGH_DEFAULT_PORTS_BOUNDARY,0,0,"", /////////////// stop server //////////////// 0, /////////////// MISC PARAMS //////////////// -0,0,0,0,0,SHATYPE_SHA1,':',0,0,TURN_CREDENTIALS_NONE,0,0,0,0, +0,0,0,0,0,SHATYPE_SHA1,':',0,0,TURN_CREDENTIALS_NONE,0,0,0,0,0, ///////////// Users DB ////////////// { TURN_USERDB_TYPE_FILE, {"\0",NULL}, {0,NULL,NULL, {NULL,0}} } @@ -400,11 +400,14 @@ static char Usage[] = "Usage: turnserver [options]\n" " This option can also be set through the database, for a particular realm.\n" " -Q, --total-quota Total allocations quota: global limit on concurrent allocations.\n" " This option can also be set through the database, for a particular realm.\n" -" -s, --max-bps Max bytes-per-second bandwidth a TURN session is allowed to handle\n" +" -s, --max-bps Default max bytes-per-second bandwidth a TURN session is allowed to handle\n" " (input and output network streams are treated separately). Anything above\n" " that limit will be dropped or temporary suppressed\n" " (within the available buffer limits).\n" " This option can also be set through the database, for a particular realm.\n" +" -B, --bps-capacity Maximum server capacity.\n" +" Total bytes-per-second bandwidth the TURN server is allowed to allocate\n" +" for the sessions, combined (input and output network streams are treated separately).\n" " -c Configuration file name (default - turnserver.conf).\n" " -b, --userdb User database file name (default - turnuserdb.conf) for long-term credentials only.\n" #if !defined(TURN_NO_PQ) @@ -592,7 +595,7 @@ static char AdminUsage[] = "Usage: turnadmin [command] [options]\n" " Setting to zero value means removal of the option.\n" " -h, --help Help\n"; -#define OPTIONS "c:d:p:L:E:X:i:m:l:r:u:b:e:M:N:O:q:Q:s:C:vVofhznaAS" +#define OPTIONS "c:d:p:L:E:X:i:m:l:r:u:b:B:e:M:N:O:q:Q:s:C:vVofhznaAS" #define ADMIN_OPTIONS "gGORIHlLkaADSdb:e:M:N:u:r:p:s:X:o:h" @@ -694,6 +697,7 @@ static struct option long_options[] = { { "user-quota", required_argument, NULL, 'q' }, { "total-quota", required_argument, NULL, 'Q' }, { "max-bps", required_argument, NULL, 's' }, + { "bps-capacity", required_argument, NULL, 'B' }, { "verbose", optional_argument, NULL, 'v' }, { "Verbose", optional_argument, NULL, 'V' }, { "daemon", optional_argument, NULL, 'o' }, @@ -1103,6 +1107,10 @@ static void set_option(int c, char *value) get_realm(NULL)->options.perf_options.max_bps = atoi(value); TURN_LOG_FUNC(TURN_LOG_LEVEL_INFO, "%lu bytes per second allowed per session\n",(unsigned long)turn_params.max_bps); break; + case 'B': + turn_params.bps_capacity = (band_limit_t)atoi(value); + TURN_LOG_FUNC(TURN_LOG_LEVEL_INFO, "%lu bytes per second allowed, combined server capacity\n",(unsigned long)turn_params.bps_capacity); + break; case NO_UDP_OPT: turn_params.no_udp = get_bool_value(value); break; diff --git a/src/apps/relay/mainrelay.h b/src/apps/relay/mainrelay.h index c5433dc0..2f56ad3c 100644 --- a/src/apps/relay/mainrelay.h +++ b/src/apps/relay/mainrelay.h @@ -299,6 +299,7 @@ typedef struct _turn_params_ { turn_credential_type ct; int use_auth_secret_with_timestamp; band_limit_t max_bps; + band_limit_t bps_capacity; vint total_quota; vint user_quota; diff --git a/src/apps/relay/turncli.c b/src/apps/relay/turncli.c index 8712493c..17dcc24b 100644 --- a/src/apps/relay/turncli.c +++ b/src/apps/relay/turncli.c @@ -714,6 +714,7 @@ static void cli_print_configuration(struct cli_session* cs) cli_print_uint(cs,(unsigned long)turn_params.min_port,"min-port",0); cli_print_uint(cs,(unsigned long)turn_params.max_port,"max-port",0); + cli_print_uint(cs,(unsigned long)turn_params.bps_capacity,"bps_capacity",0); cli_print_ip_range_list(cs,&turn_params.ip_whitelist,"Whitelist IP",0); cli_print_ip_range_list(cs,&turn_params.ip_blacklist,"Blacklist IP",0); diff --git a/src/ns_turn_defs.h b/src/ns_turn_defs.h index 363c91b2..b39538ce 100644 --- a/src/ns_turn_defs.h +++ b/src/ns_turn_defs.h @@ -31,7 +31,7 @@ #ifndef __IOADEFS__ #define __IOADEFS__ -#define TURN_SERVER_VERSION "4.0.0.2" +#define TURN_SERVER_VERSION "4.0.1.1" #define TURN_SERVER_VERSION_NAME "Threetrees" #define TURN_SOFTWARE "Coturn-"TURN_SERVER_VERSION" '"TURN_SERVER_VERSION_NAME"'"