From 416ed28d6070ea0f8a7f7ef1d6a8f084a566ce78 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 23 Jan 2005 00:52:14 +0000 Subject: Allow for the user to customize the pf optimization options in the system -> advanced menu. the default is normal. --- cf/conf/config.xml | 1 + conf.default/config.xml | 1 + etc/inc/filter.inc | 23 ++++++++-------------- usr/local/www/system_advanced.php | 41 ++++++++++++++++++++++++++++++++++++--- 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 @@ 1.4 + default priq pfSense local 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 @@ 1.4 + default priq pfSense local 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 @@ . 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) { Traffic Shaper Scheduler Type + Scheduler - > Keep diagnostics in navigation expanded - + webGUI anti-lockout > @@ -372,6 +379,34 @@ function enable_change(enable_over) { + + + PF Optimization Options + + + Disable webGUI anti-lockout rule
+ the "set LAN IP address" option in the console menu resets this setting as well. + + +   + + + + + + + + + + + + +