summaryrefslogtreecommitdiffstats
path: root/usr/local
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2013-10-31 14:50:06 -0400
committerjim-p <jimp@pfsense.org>2013-10-31 14:50:06 -0400
commitedba19827078642a765df3a49e60ab92968cacc6 (patch)
treebd2f5001e5855ae729d6f68256eab810daa4ddbe /usr/local
parent85bdf99766d2ce15ecc8247644747fe91fa08bfa (diff)
downloadpfsense-edba19827078642a765df3a49e60ab92968cacc6.zip
pfsense-edba19827078642a765df3a49e60ab92968cacc6.tar.gz
Change OpenVPN Compression settings to cover the full range of allowed settings on OpenVPN (unset, off, on, adaptive) rather than a simple off/on switch that either doesn't set the value or enables it with adaptive (OpenVPN's default).
Diffstat (limited to 'usr/local')
-rw-r--r--usr/local/www/vpn_openvpn_client.php25
-rw-r--r--usr/local/www/vpn_openvpn_server.php25
-rw-r--r--usr/local/www/wizards/openvpn_wizard.inc9
-rw-r--r--usr/local/www/wizards/openvpn_wizard.xml10
4 files changed, 41 insertions, 28 deletions
diff --git a/usr/local/www/vpn_openvpn_client.php b/usr/local/www/vpn_openvpn_client.php
index c122b79..5604b32 100644
--- a/usr/local/www/vpn_openvpn_client.php
+++ b/usr/local/www/vpn_openvpn_client.php
@@ -879,19 +879,18 @@ if ($savemsg)
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Compression"); ?></td>
<td width="78%" class="vtable">
- <table border="0" cellpadding="2" cellspacing="0">
- <tr>
- <td>
- <?php set_checked($pconfig['compression'],$chk); ?>
- <input name="compression" type="checkbox" value="yes" <?=$chk;?>>
- </td>
- <td>
- <span class="vexpl">
- <?=gettext("Compress tunnel packets using the LZO algorithm"); ?>.
- </span>
- </td>
- </tr>
- </table>
+ <select name="compression" class="formselect">
+ <?php
+ foreach ($openvpn_compression_modes as $cmode => $cmodedesc):
+ $selected = '';
+ if ($cmode == $pconfig['compression'])
+ $selected = ' selected';
+ ?>
+ <option value="<?= $cmode ?>" <?= $selected ?>><?= $cmodedesc ?></option>
+ <?php endforeach; ?>
+ </select>
+ <br/>
+ <?=gettext("Compress tunnel packets using the LZO algorithm. Adaptive compression will dynamically disable compression for a period of time if OpenVPN detects that the data in the packets is not being compressed efficiently."); ?>.
</td>
</tr>
<tr>
diff --git a/usr/local/www/vpn_openvpn_server.php b/usr/local/www/vpn_openvpn_server.php
index e59e424..aedff32 100644
--- a/usr/local/www/vpn_openvpn_server.php
+++ b/usr/local/www/vpn_openvpn_server.php
@@ -1330,19 +1330,18 @@ if ($savemsg)
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Compression"); ?></td>
<td width="78%" class="vtable">
- <table border="0" cellpadding="2" cellspacing="0">
- <tr>
- <td>
- <?php set_checked($pconfig['compression'],$chk); ?>
- <input name="compression" type="checkbox" value="yes" <?=$chk;?>>
- </td>
- <td>
- <span class="vexpl">
- <?=gettext("Compress tunnel packets using the LZO algorithm"); ?>.
- </span>
- </td>
- </tr>
- </table>
+ <select name="compression" class="formselect">
+ <?php
+ foreach ($openvpn_compression_modes as $cmode => $cmodedesc):
+ $selected = '';
+ if ($cmode == $pconfig['compression'])
+ $selected = ' selected';
+ ?>
+ <option value="<?= $cmode ?>" <?= $selected ?>><?= $cmodedesc ?></option>
+ <?php endforeach; ?>
+ </select>
+ <br/>
+ <?=gettext("Compress tunnel packets using the LZO algorithm. Adaptive compression will dynamically disable compression for a period of time if OpenVPN detects that the data in the packets is not being compressed efficiently."); ?>.
</td>
</tr>
<tr>
diff --git a/usr/local/www/wizards/openvpn_wizard.inc b/usr/local/www/wizards/openvpn_wizard.inc
index 62549d9..a6ce0df 100644
--- a/usr/local/www/wizards/openvpn_wizard.inc
+++ b/usr/local/www/wizards/openvpn_wizard.inc
@@ -335,6 +335,15 @@ function step10_stepbeforeformdisplay() {
$opt['value'] = $name;
$pkg['step'][$stepid]['fields']['field'][$idx]['options']['option'][] = $opt;
}
+ } else if ($field['name'] == "compression") {
+ global $openvpn_compression_modes;
+ $pkg['step'][$stepid]['fields']['field'][$idx]['options']['option'] = array();
+ foreach ($openvpn_compression_modes as $name => $desc) {
+ $opt = array();
+ $opt['name'] = $desc;
+ $opt['value'] = $name;
+ $pkg['step'][$stepid]['fields']['field'][$idx]['options']['option'][] = $opt;
+ }
} else if ($field['name'] == "engine") {
$pkg['step'][$stepid]['fields']['field'][$idx]['options']['option'] = array();
$engines = openvpn_get_engines();
diff --git a/usr/local/www/wizards/openvpn_wizard.xml b/usr/local/www/wizards/openvpn_wizard.xml
index c6eec60..d869c5b 100644
--- a/usr/local/www/wizards/openvpn_wizard.xml
+++ b/usr/local/www/wizards/openvpn_wizard.xml
@@ -756,9 +756,15 @@
<field>
<displayname>Compression</displayname>
<name>compression</name>
- <type>checkbox</type>
- <description>Compress tunnel packets using the LZO algorithm.</description>
+ <description>&lt;br/&gt;Compress tunnel packets using the LZO algorithm. Adaptive compression will dynamically disable compression for a period of time if OpenVPN detects that the data in the packets is not being compressed efficiently.</description>
<bindstofield>ovpnserver->step10->compression</bindstofield>
+ <type>select</type>
+ <options>
+ <option>
+ <name>dummy</name>
+ <value>dummy</value>
+ </option>
+ </options>
</field>
<field>
<displayname>Type-of-Service</displayname>
OpenPOWER on IntegriCloud