From ed682cc0ac62c961403ae9bbc0469ab690b8459b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ermal=20Lu=C3=A7i?= Date: Thu, 27 Mar 2008 20:06:47 +0000 Subject: * Remove the previous added wizard * Make the wizard generate 2 levels of queues for Local/Lan interfaces by default * Create a rule between Local interafces for multi Lan wizard * Fix other bugs on the wizards --- usr/local/www/wizards/traffic_shaper_wizard.inc | 78 ++++++++++-- .../wizards/traffic_shaper_wizard_dedicated.inc | 135 +++++++++++++++++++-- .../wizards/traffic_shaper_wizard_multi_all.inc | 124 ++++++++++++++++++- .../wizards/traffic_shaper_wizard_multi_lan.inc | 83 ++++++++++++- .../wizards/traffic_shaper_wizard_multi_lan.xml | 2 +- 5 files changed, 399 insertions(+), 23 deletions(-) (limited to 'usr/local/www/wizards') diff --git a/usr/local/www/wizards/traffic_shaper_wizard.inc b/usr/local/www/wizards/traffic_shaper_wizard.inc index 08da4fe..c303e0f 100644 --- a/usr/local/www/wizards/traffic_shaper_wizard.inc +++ b/usr/local/www/wizards/traffic_shaper_wizard.inc @@ -231,8 +231,8 @@ function step2_stepsubmitphpaction() { header("Location: wizard.php?xml=traffic_shaper_wizard.xml&stepid=1&message={$message}"); exit; } - $upbw = floatval($_POST["conn{$i}upload"]); - $downbw = floatval($_POST["conn{$i}download"]); + $upbw = $_POST["conn{$i}upload"]; + $downbw = $_POST["conn{$i}download"]; if ($upbw == 0 || $downbw = 0) { $message = gettext("You cannot specify 0 bandwidth!") ; @@ -240,6 +240,7 @@ function step2_stepsubmitphpaction() { ={$message}"); exit; } +/* if ($upbw < 128 && $_POST["conn{$i}uploadspeed"] == "Kb" && trim($_POST["conn{$i}scheduler"]) == "CBQ") { $message=gettext("We do not support Bandwidths smaller than 128Kbit/s for CBQ scheduler."); header("Location: wizard.php?xml=traffic_shaper_wizard.xml&stepid=1&message={$message}"); @@ -250,9 +251,9 @@ function step2_stepsubmitphpaction() { header("Location: wizard.php?xml=traffic_shaper_wizard.xml&stepid=1&message={$message}"); exit; } +*/ } } - /* This is necessary since the wizard expects predefined fields. */ unset($config['ezshaper']['step2']); $config['ezshaper']['step2'] = array(); @@ -1263,8 +1264,8 @@ $othersplist = array(); $altq->SetInterface('lan'); $altq->SetScheduler($config['ezshaper']['step2']["downloadscheduler"]); - $altq->SetBandwidth($lanbw/1000); - $altq->SetBwscale("Kb"); + //$altq->SetBandwidth($lanbw/1000); + //$altq->SetBwscale("Kb"); $altq->SetEnabled("on"); $altq_list_queues[$altq->GetQname()] =& $altq; array_push($tmppath, 'lan'); @@ -1293,7 +1294,7 @@ $othersplist = array(); $voipbwunit = $config['ezshaper']['step3']["downloadspeed"]; if ($sched != "HFSC") { if ($voipbwunit == "%") - $factor = $upbw/100; + $factor = $lanbw/100; else $factor = wizard_get_bandwidthtype_scale($voipbwunit); $remainbw += $voipbw * $factor; @@ -1305,7 +1306,7 @@ $othersplist = array(); $penaltybw = $config['ezshaper']['step4']['bandwidth']; $penaltybwunit = $config['ezshaper']['step4']['bandwidthunit']; if ($penaltybwunit == "%") - $factor = $upbw/100; + $factor = $lanbw/100; else $factor = wizard_get_bandwidthtype_scale($penaltybwunit); $remainbw += $penaltybw * $factor; @@ -1320,7 +1321,7 @@ $othersplist = array(); $p2pcatchbw = $config['ezshaper']['step5']['bandwidth']; $p2pcatchbwunit = $config['ezshaper']['step5']['bandwidthunit']; if ($p2pcatchbwunit == "%") - $factor = $upbw/100; + $factor = $lanbw/100; else $factor = wizard_get_bandwidthtype_scale($p2pcatchbwunit); $remainbw += $p2pcatchbw * $factor; @@ -1355,6 +1356,67 @@ $othersplist = array(); $remainbw = 100 - $remainbw; //} + if ($sched == "PRIQ") + $q =& new priq_queue(); + else if ($sched == "CBQ") + $q =& new cbq_queue(); + else if ($sched == "HFSC") + $q =& new hfsc_queue(); + $tmpcf = array(); + $tmpcf['name'] = "qLocal"; + //$tmpcf['priority'] = 6; + $tmpcf['red'] = "on"; + $tmpcf['enabled'] = "on"; + If ($sched == "CBQ" || $sched == "HFSC") { + $ifbwguess = 10 * 1000 * 1000; // 10Mbit/s + $tmpcf['bandwidth'] = ($ifbwguess - $lanbw) / 1000; + $tmpcf['bandwidthtype'] = "Kb"; + } + array_push($tmppath, "qLocal"); + $qtmp =& $altq->add_queue($q, &$tmpcf, &$tmppath, $input_errors); + array_pop($tmppath); + //echo "qLocal
"; + //var_dump($input_errors); + $qtmp->wconfig(); + + if ($sched == "PRIQ") + $q =& new priq_queue(); + else if ($sched == "CBQ") + $q =& new cbq_queue(); + else if ($sched == "HFSC") + $q =& new hfsc_queue(); + $tmpcf = array(); + $tmpcf['name'] = "qInternet"; + //$tmpcf['priority'] = 6; + $tmpcf['red'] = "on"; + $tmpcf['enabled'] = "on"; + If ($sched == "CBQ") { + $tmpcf['bandwidth'] = $lanbw/1000; + $tmpcf['bandwidthtype'] = "Kb"; + } + else if ($sched == "HFSC") { + $tmpcf['linkshare1'] = $tmpcf['linkshare3'] = $lanbw/1000 ."Kb"; + + + $tmpcf['upperlimit'] = "on"; + $tmpcf['upperlimit3'] = $lanbw/1000 ."Kb"; + + + $tmpcf['linkshare2'] = 100; + //$tmpcf['linkshare1'] = "0b"; + $tmpcf['linkshare'] = "on"; + $tmpcf['bandwidth'] = $lanbw/1000; + $tmpcf['bandwidthtype'] = "Kb"; + } + array_push($tmppath, "qInternet"); + $qtmp =& $altq->add_queue($q, &$tmpcf, &$tmppath, $input_errors); + //array_pop($tmppath); + //echo "qInternet
"; + //var_dump($input_errors); + $qtmp->wconfig(); + $altq =& $qtmp; + + if ($sched == "PRIQ") $q =& new priq_queue(); else if ($sched == "CBQ") diff --git a/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc b/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc index 5c67d06..4ee8b4b 100755 --- a/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc +++ b/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc @@ -925,8 +925,8 @@ $othersplist = array(); $altq->SetInterface($config['ezshaper']['step2']["conn{$i}interface"]); $altq->SetScheduler($config['ezshaper']['step2']["conn{$i}uploadscheduler"]); - $altq->SetBandwidth(floatval($config['ezshaper']['step2']["conn{$i}upload"])); - $altq->SetBwscale($config['ezshaper']['step2']["conn{$i}uploadspeed"]); + //$altq->SetBandwidth(floatval($config['ezshaper']['step2']["conn{$i}upload"])); + //$altq->SetBwscale($config['ezshaper']['step2']["conn{$i}uploadspeed"]); $altq->SetEnabled("on"); $altq_list_queues[$altq->GetQname()] =& $altq; array_push($tmppath, $config['ezshaper']['step2']["conn{$i}interface"]); @@ -1023,6 +1023,67 @@ $othersplist = array(); $remainbw = 100 - $remainbw; //} + if ($sched == "PRIQ") + $q =& new priq_queue(); + else if ($sched == "CBQ") + $q =& new cbq_queue(); + else if ($sched == "HFSC") + $q =& new hfsc_queue(); + $tmpcf = array(); + $tmpcf['name'] = "qLocal"; + //$tmpcf['priority'] = 6; + $tmpcf['red'] = "on"; + $tmpcf['enabled'] = "on"; + If ($sched == "CBQ" || $sched == "HFSC") { + $ifbwguess = 10 * 1000 * 1000; // 10Mbit/s + $tmpcf['bandwidth'] = ($ifbwguess - $upbw) / 1000; + $tmpcf['bandwidthtype'] = "Kb"; + } + array_push($tmppath, "qLocal"); + $qtmp =& $altq->add_queue($q, &$tmpcf, &$tmppath, $input_errors); + array_pop($tmppath); + //echo "qLocal
"; + //var_dump($input_errors); + $qtmp->wconfig(); + + if ($sched == "PRIQ") + $q =& new priq_queue(); + else if ($sched == "CBQ") + $q =& new cbq_queue(); + else if ($sched == "HFSC") + $q =& new hfsc_queue(); + $tmpcf = array(); + $tmpcf['name'] = "qInternet"; + //$tmpcf['priority'] = 6; + $tmpcf['red'] = "on"; + $tmpcf['enabled'] = "on"; + If ($sched == "CBQ") { + $tmpcf['bandwidth'] = floatval($config['ezshaper']['step2']["conn{$i}upload"]); + $tmpcf['bandwidthtype'] = $config['ezshaper']['step2']["conn{$i}uploadspeed"]; + } + else if ($sched == "HFSC") { + $tmpcf['linkshare1'] = $tmpcf['linkshare3'] = + floatval($config['ezshaper']['step2']["conn{$i}upload"]) . $config['ezshaper']['step2']["conn{$i}uploadspeed"]; + + $tmpcf['upperlimit'] = "on"; + $tmpcf['upperlimit3'] = + floatval($config['ezshaper']['step2']["conn{$i}upload"]) . $config['ezshaper']['step2']["conn{$i}uploadspeed"]; + + + $tmpcf['linkshare2'] = 100; + //$tmpcf['linkshare1'] = "0b"; + $tmpcf['linkshare'] = "on"; + $tmpcf['bandwidth'] = floatval($config['ezshaper']['step2']["conn{$i}upload"]); + $tmpcf['bandwidthtype'] = $config['ezshaper']['step2']["conn{$i}uploadspeed"]; + } + array_push($tmppath, "qInternet"); + $qtmp =& $altq->add_queue($q, &$tmpcf, &$tmppath, $input_errors); + //array_pop($tmppath); + //echo "qInternet
"; + //var_dump($input_errors); + $qtmp->wconfig(); + $altq =& $qtmp; + if ($sched == "PRIQ") $q =& new priq_queue(); else if ($sched == "CBQ") @@ -1301,8 +1362,8 @@ $othersplist = array(); $altq->SetInterface($config['ezshaper']['step2']["local{$i}interface"]); $altq->SetScheduler($config['ezshaper']['step2']["local{$i}downloadscheduler"]); - $altq->SetBandwidth($config['ezshaper']['step2']["conn{$i}download"]); - $altq->SetBwscale($config['ezshaper']['step2']["conn{$i}downloadspeed"]); + //$altq->SetBandwidth($config['ezshaper']['step2']["conn{$i}download"]); + //$altq->SetBwscale($config['ezshaper']['step2']["conn{$i}downloadspeed"]); $altq->SetEnabled("on"); $altq_list_queues[$altq->GetQname()] =& $altq; array_push($tmppath, $config['ezshaper']['step2']["local{$i}interface"]); @@ -1331,7 +1392,7 @@ $othersplist = array(); $voipbwunit = $config['ezshaper']['step3']["local{$i}downloadspeed"]; if ($scehd != HFSC) { if ($penaltybwunit == "%") - $factor = $lanbw/100; + $factor = $downbw/100; else $factor = wizard_get_bandwidthtype_scale($voipbwunit); $remainbw += floatval($voipbw) * $factor; @@ -1343,7 +1404,7 @@ $othersplist = array(); $penaltybw = $config['ezshaper']['step4']['bandwidth']; $penaltybwunit = $config['ezshaper']['step4']['bandwidthunit']; if ($penaltybwunit == "%") - $factor = $lanbw/100; + $factor = $downbw/100; else $factor = wizard_get_bandwidthtype_scale($penaltybwunit); $remainbw += floatval($penaltybw) * $factor; @@ -1358,7 +1419,7 @@ $othersplist = array(); $p2pcatchbw = $config['ezshaper']['step5']['bandwidth']; $p2pcatchbwunit = $config['ezshaper']['step5']['bandwidthunit']; if ($p2pcatchbwunit == "%") - $factor = $upbw/100; + $factor = $downbw/100; else $factor = wizard_get_bandwidthtype_scale($p2pcatchbwunit); $remainbw += floatval($p2pcatchbw) * $factor; @@ -1393,6 +1454,66 @@ $othersplist = array(); $remainbw = 100 - $remainbw; //} + if ($sched == "PRIQ") + $q =& new priq_queue(); + else if ($sched == "CBQ") + $q =& new cbq_queue(); + else if ($sched == "HFSC") + $q =& new hfsc_queue(); + $tmpcf = array(); + $tmpcf['name'] = "qLocal"; + //$tmpcf['priority'] = 6; + $tmpcf['red'] = "on"; + $tmpcf['enabled'] = "on"; + If ($sched == "CBQ" || $sched == "HFSC") { + $ifbwguess = 10 * 1000 * 1000; // 10Mbit/s + $tmpcf['bandwidth'] = ($ifbwguess - $downbw) / 1000; + $tmpcf['bandwidthtype'] = "Kb"; + } + array_push($tmppath, "qLocal"); + $qtmp =& $altq->add_queue($q, &$tmpcf, &$tmppath, $input_errors); + array_pop($tmppath); + //echo "qLocal
"; + //var_dump($input_errors); + $qtmp->wconfig(); + + if ($sched == "PRIQ") + $q =& new priq_queue(); + else if ($sched == "CBQ") + $q =& new cbq_queue(); + else if ($sched == "HFSC") + $q =& new hfsc_queue(); + $tmpcf = array(); + $tmpcf['name'] = "qInternet"; + //$tmpcf['priority'] = 6; + $tmpcf['red'] = "on"; + $tmpcf['enabled'] = "on"; + If ($sched == "CBQ") { + $tmpcf['bandwidth'] = floatval($config['ezshaper']['step2']["conn{$i}download"]); + $tmpcf['bandwidthtype'] = $config['ezshaper']['step2']["conn{$i}downloadspeed"]; + } + else if ($sched == "HFSC") { + $tmpcf['linkshare1'] = $tmpcf['linkshare3'] = + floatval($config['ezshaper']['step2']["conn{$i}download"]) . $config['ezshaper']['step2']["conn{$i}downloadspeed"]; + + $tmpcf['upperlimit'] = "on"; + $tmpcf['upperlimit3'] = + floatval($config['ezshaper']['step2']["conn{$i}download"]) . $config['ezshaper']['step2']["conn{$i}downloadspeed"]; + + $tmpcf['linkshare2'] = 100; + //$tmpcf['linkshare1'] = "0b"; + $tmpcf['linkshare'] = "on"; + $tmpcf['bandwidth'] = floatval($config['ezshaper']['step2']["conn{$i}download"]); + $tmpcf['bandwidthtype'] = $config['ezshaper']['step2']["conn{$i}downloadspeed"]; + } + array_push($tmppath, "qInternet"); + $qtmp =& $altq->add_queue($q, &$tmpcf, &$tmppath, $input_errors); + //array_pop($tmppath); + //echo "qInternet
"; + //var_dump($input_errors); + $qtmp->wconfig(); + $altq =& $qtmp; + if ($sched == "PRIQ") $q =& new priq_queue(); else if ($sched == "CBQ") diff --git a/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc b/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc index 15a28b0..2c8944f 100755 --- a/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc +++ b/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc @@ -970,8 +970,8 @@ $othersplist = array(); $altq->SetInterface($config['ezshaper']['step2']["conn{$i}interface"]); $altq->SetScheduler($config['ezshaper']['step2']["conn{$i}uploadscheduler"]); - $altq->SetBandwidth(floatval($config['ezshaper']['step2']["conn{$i}upload"])); - $altq->SetBwscale($config['ezshaper']['step2']["conn{$i}uploadspeed"]); + //$altq->SetBandwidth(floatval($config['ezshaper']['step2']["conn{$i}upload"])); + //$altq->SetBwscale($config['ezshaper']['step2']["conn{$i}uploadspeed"]); $altq->SetEnabled("on"); $altq_list_queues[$altq->GetQname()] =& $altq; array_push($tmppath, $config['ezshaper']['step2']["conn{$i}interface"]); @@ -1068,6 +1068,66 @@ $othersplist = array(); $remainbw = 100 - $remainbw; //} + if ($sched == "PRIQ") + $q =& new priq_queue(); + else if ($sched == "CBQ") + $q =& new cbq_queue(); + else if ($sched == "HFSC") + $q =& new hfsc_queue(); + $tmpcf = array(); + $tmpcf['name'] = "qLocal"; + //$tmpcf['priority'] = 6; + $tmpcf['red'] = "on"; + $tmpcf['enabled'] = "on"; + If ($sched == "CBQ" || $sched == "HFSC") { + $ifbwguess = 10 * 1000 * 1000; // 10Mbit/s + $tmpcf['bandwidth'] = ($ifbwguess - $upbw) / 1000; + $tmpcf['bandwidthtype'] = "Kb"; + } + array_push($tmppath, "qLocal"); + $qtmp =& $altq->add_queue($q, &$tmpcf, &$tmppath, $input_errors); + array_pop($tmppath); + //echo "qLocal
"; + //var_dump($input_errors); + $qtmp->wconfig(); + + if ($sched == "PRIQ") + $q =& new priq_queue(); + else if ($sched == "CBQ") + $q =& new cbq_queue(); + else if ($sched == "HFSC") + $q =& new hfsc_queue(); + $tmpcf = array(); + $tmpcf['name'] = "qInternet"; + //$tmpcf['priority'] = 6; + $tmpcf['red'] = "on"; + $tmpcf['enabled'] = "on"; + If ($sched == "CBQ") { + $tmpcf['bandwidth'] = floatval($config['ezshaper']['step2']["conn{$i}upload"]); + $tmpcf['bandwidthtype'] = $config['ezshaper']['step2']["conn{$i}uploadspeed"]; + } + else if ($sched == "HFSC") { + $tmpcf['linkshare1'] = $tmpcf['linkshare3'] = + floatval($config['ezshaper']['step2']["conn{$i}upload"]) . $config['ezshaper']['step2']["conn{$i}uploadspeed"]; + $tmpcf['upperlimit3'] = + floatval($config['ezshaper']['step2']["conn{$i}upload"]) . $config['ezshaper']['step2']["conn{$i}uploadspeed"]; + $tmpcf['upperlimit'] = "on"; + + + $tmpcf['linkshare2'] = 100; + //$tmpcf['linkshare1'] = "0b"; + $tmpcf['linkshare'] = "on"; + $tmpcf['bandwidth'] = floatval($config['ezshaper']['step2']["conn{$i}upload"]); + $tmpcf['bandwidthtype'] = $config['ezshaper']['step2']["conn{$i}uploadspeed"]; + } + array_push($tmppath, "qInternet"); + $qtmp =& $altq->add_queue($q, &$tmpcf, &$tmppath, $input_errors); + //array_pop($tmppath); + //echo "qInternet
"; + //var_dump($input_errors); + $qtmp->wconfig(); + $altq =& $qtmp; + if ($sched == "PRIQ") $q =& new priq_queue(); else if ($sched == "CBQ") @@ -1355,8 +1415,8 @@ $othersplist = array(); $altq->SetInterface($config['ezshaper']['step2']["local{$i}interface"]); $altq->SetScheduler($config['ezshaper']['step2']["local{$i}downloadscheduler"]); - $altq->SetBandwidth($lanbw/1000); - $altq->SetBwscale("Kb"); + //$altq->SetBandwidth($lanbw/1000); + //$altq->SetBwscale("Kb"); $altq->SetEnabled("on"); $altq_list_queues[$altq->GetQname()] =& $altq; array_push($tmppath, $config['ezshaper']['step2']["local{$i}interface"]); @@ -1447,6 +1507,62 @@ $othersplist = array(); $remainbw = 100 - $remainbw; //} + if ($sched == "PRIQ") + $q =& new priq_queue(); + else if ($sched == "CBQ") + $q =& new cbq_queue(); + else if ($sched == "HFSC") + $q =& new hfsc_queue(); + $tmpcf = array(); + $tmpcf['name'] = "qLocal"; + //$tmpcf['priority'] = 6; + $tmpcf['red'] = "on"; + $tmpcf['enabled'] = "on"; + If ($sched == "CBQ" || $sched == "HFSC") { + $ifbwguess = 10 * 1000 * 1000; // 10Mbit/s + $tmpcf['bandwidth'] = ($ifbwguess - $lanbw) / 1000; + $tmpcf['bandwidthtype'] = "Kb"; + } + array_push($tmppath, "qLocal"); + $qtmp =& $altq->add_queue($q, &$tmpcf, &$tmppath, $input_errors); + array_pop($tmppath); + //echo "qLocal
"; + //var_dump($input_errors); + $qtmp->wconfig(); + + if ($sched == "PRIQ") + $q =& new priq_queue(); + else if ($sched == "CBQ") + $q =& new cbq_queue(); + else if ($sched == "HFSC") + $q =& new hfsc_queue(); + $tmpcf = array(); + $tmpcf['name'] = "qInternet"; + //$tmpcf['priority'] = 6; + $tmpcf['red'] = "on"; + $tmpcf['enabled'] = "on"; + If ($sched == "CBQ") { + $tmpcf['bandwidth'] = $lanbw/1000; + $tmpcf['bandwidthtype'] = "Kb"; + } + else if ($sched == "HFSC") { + $tmpcf['linkshare1'] = $tmpcf['linkshare3'] = $lanbw/1000 . "Kb"; + $tmpcf['upperlimit3'] = $lanbw/1000 . "Kb"; + $tmpcf['upperlimit'] = "on"; + $tmpcf['linkshare2'] = 100; + //$tmpcf['linkshare1'] = "0b"; + $tmpcf['linkshare'] = "on"; + $tmpcf['bandwidth'] = $lanbw/1000; + $tmpcf['bandwidthtype'] = "Kb"; + } + array_push($tmppath, "qInternet"); + $qtmp =& $altq->add_queue($q, &$tmpcf, &$tmppath, $input_errors); + //array_pop($tmppath); + //echo "qInternet
"; + //var_dump($input_errors); + $qtmp->wconfig(); + $altq =& $qtmp; + if ($sched == "PRIQ") $q =& new priq_queue(); else if ($sched == "CBQ") diff --git a/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc b/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc index b0061bc..088ea8f 100644 --- a/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc +++ b/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc @@ -845,6 +845,66 @@ $othersplist = array(); $remainbw = 100 - $remainbw; //} + if ($sched == "PRIQ") + $q =& new priq_queue(); + else if ($sched == "CBQ") + $q =& new cbq_queue(); + else if ($sched == "HFSC") + $q =& new hfsc_queue(); + $tmpcf = array(); + $tmpcf['name'] = "qLocal"; + //$tmpcf['priority'] = 6; + $tmpcf['red'] = "on"; + $tmpcf['enabled'] = "on"; + If ($sched == "CBQ" || $sched == "HFSC") { + $ifbwguess = 10 * 1000 * 1000; // 10Mbit/s + $tmpcf['bandwidth'] = ($ifbwguess - $upbw) / 1000; + $tmpcf['bandwidthtype'] = "Kb"; + } + array_push($tmppath, "qLocal"); + $qtmp =& $altq->add_queue($q, &$tmpcf, &$tmppath, $input_errors); + array_pop($tmppath); + //echo "qLocal
"; + //var_dump($input_errors); + $qtmp->wconfig(); + + if ($sched == "PRIQ") + $q =& new priq_queue(); + else if ($sched == "CBQ") + $q =& new cbq_queue(); + else if ($sched == "HFSC") + $q =& new hfsc_queue(); + $tmpcf = array(); + $tmpcf['name'] = "qInternet"; + //$tmpcf['priority'] = 6; + $tmpcf['red'] = "on"; + $tmpcf['enabled'] = "on"; + If ($sched == "CBQ") { + $tmpcf['bandwidth'] = floatval($config['ezshaper']['step2']["conndownload"]); + $tmpcf['bandwidthtype'] = $config['ezshaper']['step2']["conndownloadspeed"]; + } + else if ($sched == "HFSC") { + $tmpcf['linkshare1'] = $tmpcf['linkshare3'] = + floatval($config['ezshaper']['step2']["conndownload"]) . $config['ezshaper']['step2']["conndownloadspeed"]; + $tmpcf['upperlimit'] = "on"; + $tmpcf['upperlimit3'] = + floatval($config['ezshaper']['step2']["conndownload"]) . $config['ezshaper']['step2']["conndownloadspeed"]; + + $tmpcf['linkshare2'] = 100; + //$tmpcf['linkshare1'] = "0b"; + $tmpcf['linkshare'] = "on"; + $tmpcf['bandwidth'] = floatval($config['ezshaper']['step2']["conndownload"]); + $tmpcf['bandwidthtype'] = $config['ezshaper']['step2']["conndownloadspeed"]; + } + array_push($tmppath, "qInternet"); + $qtmp =& $altq->add_queue($q, &$tmpcf, &$tmppath, $input_errors); + //array_pop($tmppath); + //echo "qInternet
"; + //var_dump($input_errors); + $qtmp->wconfig(); + $altq =& $qtmp; + + if ($sched == "PRIQ") $q =& new priq_queue(); else if ($sched == "CBQ") @@ -1153,7 +1213,7 @@ $othersplist = array(); $voipbwunit = $config['ezshaper']['step3']["connuploadspeed"]; if ($sched != "HFSC") { if ($voipbwunit == "%") - $factor = $upbw/100; + $factor = $lanbw/100; else $factor = wizard_get_bandwidthtype_scale($voipbwunit); $remainbw += $voipbw * $factor; @@ -1165,7 +1225,7 @@ $othersplist = array(); $penaltybw = $config['ezshaper']['step4']['bandwidth']; $penaltybwunit = $config['ezshaper']['step4']['bandwidthunit']; if ($penaltybwunit == "%") - $factor = $upbw/100; + $factor = $lanbw/100; else $factor = wizard_get_bandwidthtype_scale($penaltybwunit); $remainbw += $penaltybw * $factor; @@ -1180,7 +1240,7 @@ $othersplist = array(); $p2pcatchbw = $config['ezshaper']['step5']['bandwidth']; $p2pcatchbwunit = $config['ezshaper']['step5']['bandwidthunit']; if ($p2pcatchbwunit == "%") - $factor = $upbw/100; + $factor = $lanbw/100; else $factor = wizard_get_bandwidthtype_scale($p2pcatchbwunit); $remainbw += $p2pcatchbw * $factor; @@ -1659,6 +1719,23 @@ $othersplist = array(); } } } + $rule = array(); + $rule['defaultqueue'] = 'qLocal'; + $rule['source']['any'] = TRUE; + $rule['destination']['any'] = TRUE; + $rule['floating'] = "yes"; + $rule['wizard'] = "yes"; + $rule['enabled'] = "on"; + $rule['descr'] = "Local traffic "; + for ($i = 0; $i < $steps; $i++) { + if ($config['ezshaper']['step2']["conn{$i}interface"] == "wan") + continue; + $rule['interface'] .= $config['ezshaper']['step2']["conn{$i}interface"]; + if ($i > 0 && $i < $steps - 1) + $rule['interface'] .= ","; + } + $config['filter']['rule'][] = $rule; + write_config(); } diff --git a/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.xml b/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.xml index 96408d3..8a210b1 100644 --- a/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.xml +++ b/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.xml @@ -2,7 +2,7 @@ /* $Id$ */ - traffic_shaper_wizard_multi_lan.xml + traffic_shaper_wizard_multi_lan2.xml part of pfSense (http://www.pfsense.org/) Copyright (C) 2005 Bill Marquette - bill.marquette@gmail.com. -- cgit v1.1