summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/inc/openvpn.inc6
-rw-r--r--usr/local/pkg/openvpn_cli.xml6
2 files changed, 12 insertions, 0 deletions
diff --git a/etc/inc/openvpn.inc b/etc/inc/openvpn.inc
index 67d8896..475174e 100644
--- a/etc/inc/openvpn.inc
+++ b/etc/inc/openvpn.inc
@@ -112,6 +112,10 @@ function openvpn_validate_input($mode, $post, $input_errors) {
if ($post['protocol'] != "TCP")
$input_errors[] = 'The protocol must be TCP to use a HTTP proxy server.';
}
+ if (isset($post['use_shaper']) && $post['use_shaper'] != "") {
+ if (!is_numeric($post['use_shaper']))
+ $input_errors[] = 'The field \'Limit outgoing bandwith\' must be numeric.';
+ }
}
@@ -306,6 +310,8 @@ EOD;
$openvpn_conf .= "float\n";
}
+ if (!empty($settings['use_shaper'])) $openvpn_conf .= "shaper {$settings['use_shaper']}\n";
+
if (!empty($settings['custom_options'])) {
$options = explode(';', $settings['custom_options']);
if (is_array($options)) {
diff --git a/usr/local/pkg/openvpn_cli.xml b/usr/local/pkg/openvpn_cli.xml
index fd4b03e..e4a6ead 100644
--- a/usr/local/pkg/openvpn_cli.xml
+++ b/usr/local/pkg/openvpn_cli.xml
@@ -175,6 +175,12 @@
<type>checkbox</type>
</field>
<field>
+ <fieldname>use_shaper</fieldname>
+ <fielddescr>Limit outgoing bandwith</fielddescr>
+ <description>Maximum outgoing bandwith for this tunnel. Leave empty for no limit. The imput value has to be something between 100 bytes/sec and 100 Mbytes/sec (entered as bytes per second).</description>
+ <type>input</type>
+ </field>
+ <field>
<fieldname>use_dynamicport</fieldname>
<fielddescr>Dynamic sourceport</fielddescr>
<description>Checking this will let the openvpn client choose a dynamic sourceport for this connection.</description>
OpenPOWER on IntegriCloud