diff options
-rw-r--r-- | etc/inc/filter.inc | 11 | ||||
-rwxr-xr-x | usr/local/www/firewall_shaper_queues_edit.php | 23 |
2 files changed, 27 insertions, 7 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index 417f3fa..4b7d664 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -112,8 +112,15 @@ function filter_generate_altq_queues() { $altq_rules .= "bandwidth " . $rule['bandwidth'] . " "; if (isset($rule['priority'])) $altq_rules .= "priority " . $rule['priority'] . " "; - if (isset($rule['options'])) /* XXX turn options into an xml array */ - $altq_rules .= $rule['schedulertype'] . "(". $rule['options'] . ")"; + $options = ""; + if(isset($rule['options']['red'])) + $options .= " red"; + if(isset($rule['options']['ecn'])) + $options .= " ecn"; + if(isset($rule['options']['default'])) + $options .= " default"; + if($options) + $altq_rules .= $rule['schedulertype'] . "(". $options . " )"; if (isset($rule['subqueue'])) { $altq_rules .= "{ "; $fsq = ""; diff --git a/usr/local/www/firewall_shaper_queues_edit.php b/usr/local/www/firewall_shaper_queues_edit.php index e040620..cffe15a 100755 --- a/usr/local/www/firewall_shaper_queues_edit.php +++ b/usr/local/www/firewall_shaper_queues_edit.php @@ -43,8 +43,23 @@ if (isset($id) && $a_queues[$id]) { $pconfig['mask'] = $a_queues[$id]['mask']; $pconfig['name'] = $a_queues[$id]['name']; $pconfig['options'] = $a_queues[$id]['options']; + + if(isset($pconfig['options']['red'])) { + $pconfig['options']['red'] = $queue['options']['red']; + $red = "on"; + } + if(isset($pconfig['options']['ecn'])) { + $pconfig['options']['ecn'] = $queue['options']['ecn']; + $ecn = "on"; + } + if(isset($pconfig['options']['default'])) { + $pconfig['options']['default'] = $queue['options']['default']; + $default = "on"l + } + $pconfig['bandwidth'] = $a_queues[$id]['bandwidth']; $pconfig['bandwidthtype'] = $a_queues[$id]['bandwidthtype']; + } if ($_POST) { @@ -73,15 +88,13 @@ if ($_POST) { $scheduleroptions=""; if($_POST['red'] == "on") - $scheduleroptions .= "red "; + $queue['options']['red'] = "enabled"; if($_POST['ecn'] == "on") - $scheduleroptions .= "ecn "; + $queue['options']['ecn'] = "enabled"; if($_POST['default'] == "on") - $scheduleroptions .= "default"; - - $queue['options'] = $scheduleroptions; + $queue['options']['default'] = "eanbled"; if (isset($id) && $a_queues[$id]) $a_queues[$id] = $queue; |