summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-01-23 00:52:14 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-01-23 00:52:14 +0000
commit416ed28d6070ea0f8a7f7ef1d6a8f084a566ce78 (patch)
tree0dac5584325b31fb429660b06c12e4a072c6d3b2
parent121efc39328a265e2854abbaa4de0727d2b402a3 (diff)
downloadpfsense-416ed28d6070ea0f8a7f7ef1d6a8f084a566ce78.zip
pfsense-416ed28d6070ea0f8a7f7ef1d6a8f084a566ce78.tar.gz
Allow for the user to customize the pf optimization options in the system -> advanced menu. the default is normal.
-rw-r--r--cf/conf/config.xml1
-rw-r--r--conf.default/config.xml1
-rw-r--r--etc/inc/filter.inc23
-rwxr-xr-xusr/local/www/system_advanced.php41
4 files changed, 48 insertions, 18 deletions
diff --git a/cf/conf/config.xml b/cf/conf/config.xml
index 3cff4e1..816fd11 100644
--- a/cf/conf/config.xml
+++ b/cf/conf/config.xml
@@ -4,6 +4,7 @@
<version>1.4</version>
<lastchange></lastchange>
<system>
+ <optimization>default</optimization>
<schedulertype>priq</schedulertype>
<hostname>pfSense</hostname>
<domain>local</domain>
diff --git a/conf.default/config.xml b/conf.default/config.xml
index 3cff4e1..816fd11 100644
--- a/conf.default/config.xml
+++ b/conf.default/config.xml
@@ -4,6 +4,7 @@
<version>1.4</version>
<lastchange></lastchange>
<system>
+ <optimization>default</optimization>
<schedulertype>priq</schedulertype>
<hostname>pfSense</hostname>
<domain>local</domain>
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index b8c798d..2e26dd0 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -95,7 +95,9 @@ function filter_configure() {
$fd = fopen("/tmp/rules.debug", "w");
fwrite($fd, "set loginterface $wanif \n");
- fwrite($fd, "set optimization aggressive\n");
+ $optimization = "normal";
+ if($config['system']['optimization'] <> "") $optimization = $config['system']['optimization'];
+ fwrite($fd, "set optimization " . $optimization . "\n");
fwrite($fd, "\nscrub in all\n");
fwrite($fd, $altq_ints);
fwrite($fd, $altq_queues);
@@ -127,16 +129,7 @@ function filter_configure() {
function filter_get_altq_queue_scheduler_type($associatedrule) {
global $config;
- $schedulertype = "";
- /* XXX: assign all the OPT interfaces */
- foreach ($config['shaper']['rule'] as $rule) {
- if($rule['descr'] == $associatedrule) {
- if($rule['interface'] == "wan") $schedulertpye = $config['system']['schedulertype'];
- if($rule['interface'] == "lan") $schedulertpye = $config['system']['schedulertype'];
- $schedulertpye = $config['system']['schedulertype'];
- }
- }
- return $schedulertpye;
+ return $config['system']['schedulertype'];
}
function filter_get_rule_real_interface($associatedrulenumber) {
@@ -187,10 +180,10 @@ function filter_generate_altq_queues() {
if(isset($rule['realtime']) and $rule['realtime'] <> "") {
$options .= " realtime(" . $rule['realtime1'] . " " . $rule['realtime2'] . " " . $rule['realtime3'] . ")";
}
- if($options) {
- $scheduler_type = $config['system']['schedulertype'];
- $altq_rules .= $scheduler_type . "(". $options . " )";
- }
+ $scheduler_type = $config['system']['schedulertype'];
+ $altq_rules .= $scheduler_type . " ";
+ if($options)
+ $altq_rules .= "(". $options . " )";
if (isset($rule['subqueue'])) {
$altq_rules .= "{ ";
$fsq = "";
diff --git a/usr/local/www/system_advanced.php b/usr/local/www/system_advanced.php
index efd584a..1fb8e06 100755
--- a/usr/local/www/system_advanced.php
+++ b/usr/local/www/system_advanced.php
@@ -2,8 +2,10 @@
<?php
/*
system_advanced.php
- part of m0n0wall (http://m0n0.ch/wall)
+ part of pfSense
+ Copyright (C) 2005 Scott Ullrich
+ originally part of m0n0wall (http://m0n0.ch/wall)
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
All rights reserved.
@@ -91,6 +93,8 @@ if ($_POST) {
$config['system']['disablefirmwarecheck'] = $_POST['disablefirmwarecheck'] ? true : false;
$config['system']['webgui']['expanddiags'] = $_POST['expanddiags'] ? true : false;
+ $config['system']['optimization'] = $_POST['optimization'];
+
if ($g['platform'] == "generic-pc") {
$oldharddiskstandby = $config['system']['harddiskstandby'];
$config['system']['harddiskstandby'] = $_POST['harddiskstandby'];
@@ -138,6 +142,7 @@ if ($_POST) {
function enable_change(enable_over) {
if (document.iform.ipv6nat_enable.checked || enable_over) {
document.iform.ipv6nat_ipaddr.disabled = 0;
+ document.iform.schedulertype.disabled = 0;
} else {
document.iform.ipv6nat_ipaddr.disabled = 1;
}
@@ -179,10 +184,10 @@ function enable_change(enable_over) {
<tr>
<td colspan="2" valign="top" class="listtopic">Traffic Shaper Scheduler Type</td>
</tr>
+
<tr>
<td width="22%" valign="top" class="vncell"><b>Scheduler</b> </td>
<td width="78%" class="vtable">
-
<select id="schedulertype" name="schedulertype" <?= $style ?>>
<?php
if($pconfig['schedulertype'] == 'priq')
@@ -206,6 +211,8 @@ function enable_change(enable_over) {
<?php endif; ?>
</span></td>
</tr>
+
+
<tr>
<td width="22%" valign="top">&nbsp;</td>
<td width="78%">
@@ -357,7 +364,7 @@ function enable_change(enable_over) {
<input name="expanddiags" type="checkbox" id="expanddiags" value="yes" <?php if ($pconfig['expanddiags']) echo "checked"; ?>>
<strong>Keep diagnostics in navigation expanded </strong></td>
</tr>
- <tr>
+ <tr>
<td width="22%" valign="top" class="vncell">webGUI anti-lockout</td>
<td width="78%" class="vtable">
<input name="noantilockout" type="checkbox" id="noantilockout" value="yes" <?php if ($pconfig['noantilockout']) echo "checked"; ?>>
@@ -372,6 +379,34 @@ function enable_change(enable_over) {
<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)">
</td>
</tr>
+
+ <tr>
+ <td width="22%" valign="top" class="vncell">PF Optimization Options</td>
+ <td width="78%" class="vtable">
+ <select name="optimization" id="optimization">
+ <option value="normal"<?php if($config['system']['optimization']=="normal") echo " SELECTED"; ?>>normal - as the name says, it's the normal optimization algorithm.</option>
+ <option value="high-latency"<?php if($config['system']['optimization']=="high-latency") echo " SELECTED"; ?>>high-latency - used for high latency links, such as satellite links. Expires idle connections later than default.</option>
+ <option value="agressive"<?php if($config['system']['optimization']=="agressive") echo " SELECTED"; ?>>agressive - expires idle connections earlier than default; using less memory and CPU time while possibly dropping some legitimate connections.</option>
+ <option value="conservative"<?php if($config['system']['optimization']=="conservative") echo " SELECTED"; ?>>conservative - tries to avoid dropping any legitimate connections at the expense of increased memory usage and CPU utilization.</option>
+ </select>
+ <strong>Disable webGUI anti-lockout rule</strong><br>
+ the &quot;set LAN IP address&quot; option in the console menu resets this setting as well.</td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top">&nbsp;</td>
+ <td width="78%">
+ <input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)">
+ </td>
+ </tr>
+
+
+
+
+
+
+
+
+
</table>
</form>
<script language="JavaScript">
OpenPOWER on IntegriCloud