Browse Source

working on bandwidth draft

mom040267 11 years ago
parent
commit
5a339c60df

+ 4 - 0
ChangeLog

@@ -1,3 +1,7 @@
+05/25/2014 Oleg Moskalenko <[email protected]>
+Version 4.0.1.1 'Threetrees':
+	- Bandwidth draft implemented.
+
 05/18/2014 Oleg Moskalenko <[email protected]>
 Version 4.0.0.2 'Threetrees':
 	- Code cleaning.

+ 5 - 0
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 

+ 7 - 0
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.
 #

+ 1 - 1
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 

+ 8 - 1
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 

+ 1 - 1
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

+ 1 - 1
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

+ 3 - 1
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 <[email protected]>
+  - Sync to 4.0.1.1
 * Sun May 18 2014 Oleg Moskalenko <[email protected]>
   - Sync to 4.0.0.2
 * Wed May 07 2014 Oleg Moskalenko <[email protected]>

+ 11 - 3
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		<number>	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			<number>	Max bytes-per-second bandwidth a TURN session is allowed to handle\n"
+" -s, --max-bps			<number>	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		<number>	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				<filename>	Configuration file name (default - turnserver.conf).\n"
 " -b, --userdb			<filename>	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;

+ 1 - 0
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;
 

+ 1 - 0
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);

+ 1 - 1
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"'"