1
0
mirror of https://github.com/coturn/coturn.git synced 2025-10-23 20:11:17 +02:00

working on bandwidth draft

This commit is contained in:
mom040267 2014-05-26 07:37:16 +00:00
parent 0cd2b66e55
commit 5a339c60df
12 changed files with 44 additions and 9 deletions

View File

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

View File

@ -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

View File

@ -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.
#

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 <mom040267@gmail.com>
- Sync to 4.0.1.1
* Sun May 18 2014 Oleg Moskalenko <mom040267@gmail.com>
- Sync to 4.0.0.2
* Wed May 07 2014 Oleg Moskalenko <mom040267@gmail.com>

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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"'"