summaryrefslogtreecommitdiffstats
path: root/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2011-07-15 18:19:58 +0000
committerErmal <eri@pfsense.org>2011-07-15 18:19:58 +0000
commit1750ed78d6c942b2aee3ff081cbcf903e92ea946 (patch)
tree07931efc13020a7474130bf0e665addf98da9ccf /usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc
parent746fc9ec0a020a69a1636b153c48ba8f1b070785 (diff)
downloadpfsense-1750ed78d6c942b2aee3ff081cbcf903e92ea946.zip
pfsense-1750ed78d6c942b2aee3ff081cbcf903e92ea946.tar.gz
Re-enable downstream queues but with the difference that the default queue now tries to use all the link when possible and the bandwidth limit is specified on a subqueue instead of the interface.
Diffstat (limited to 'usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc')
-rwxr-xr-xusr/local/www/wizards/traffic_shaper_wizard_multi_all.inc196
1 files changed, 96 insertions, 100 deletions
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 a537a6c..539258b 100755
--- a/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc
+++ b/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc
@@ -1048,7 +1048,7 @@ function apply_all_choosen_items() {
array_pop($tmppath);
}
-/* LAN bandwidth ----------------------------------------------------------------------------------------- */
+ /* LAN bandwidth ----------------------------------------------------------------------------------------- */
$localint = intval($config['ezshaper']['step1']['numberoflocalinterfaces']);
$lanbw = 0;
for ($i = 0; $i < $steps; $i++) {
@@ -1064,8 +1064,8 @@ function apply_all_choosen_items() {
$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"]);
@@ -1088,75 +1088,102 @@ function apply_all_choosen_items() {
$remainbw = 0;
- if ($config['ezshaper']['step3']['enable']) {
- $voip = true;
- $voipbw = $config['ezshaper']['step3']["local{$i}download"];
- $voipbwunit = $config['ezshaper']['step3']["local{$i}downloadspeed"];
- if ($sched != HFSC) {
- if ($penaltybwunit == "%")
- $factor = $lanbw/100;
- else
- $factor = wizard_get_bandwidthtype_scale($voipbwunit);
- $remainbw += floatval($voipbw) * $factor;
- } else
- $remainbw += 32000; /* 32Kbit/s reserved for HFSC linksharing */
- }
- if ($config['ezshaper']['step4']['enable']) {
- $penalty = true;
- $penaltybw = $config['ezshaper']['step4']['bandwidth'];
- $penaltybwunit = $config['ezshaper']['step4']['bandwidthunit'];
- if ($penaltybwunit == "%")
- $factor = $lanbw/100;
- else
- $factor = wizard_get_bandwidthtype_scale($penaltybwunit);
- $remainbw += floatval($penaltybw) * $factor;
- } else {
- $penalty = false;
- $penaltybw = 0;
- }
- if ($config['ezshaper']['step5']['enable']) {
- $p2p = true;
- if ($config['ezshaper']['step5']['p2pcatchall']) {
- $p2pcatchall = true;
- $p2pcatchbw = $config['ezshaper']['step5']['bandwidth'];
- $p2pcatchbwunit = $config['ezshaper']['step5']['bandwidthunit'];
- if ($p2pcatchbwunit == "%")
- $factor = $upbw/100;
- else
- $factor = wizard_get_bandwidthtype_scale($p2pcatchbwunit);
- $remainbw += floatval($p2pcatchbw) * $factor;
- } else {
- $p2pcatchall = false;
- $p2pcatchbw = 0;
- }
+ if ($config['ezshaper']['step3']['enable']) {
+ $voip = true;
+ $voipbw = $config['ezshaper']['step3']["local{$i}download"];
+ $voipbwunit = $config['ezshaper']['step3']["local{$i}downloadspeed"];
+ if ($sched != HFSC) {
+ if ($penaltybwunit == "%")
+ $factor = $lanbw/100;
+ else
+ $factor = wizard_get_bandwidthtype_scale($voipbwunit);
+ $remainbw += floatval($voipbw) * $factor;
+ } else
+ $remainbw += 32000; /* 32Kbit/s reserved for HFSC linksharing */
+ }
+ if ($config['ezshaper']['step4']['enable']) {
+ $penalty = true;
+ $penaltybw = $config['ezshaper']['step4']['bandwidth'];
+ $penaltybwunit = $config['ezshaper']['step4']['bandwidthunit'];
+ if ($penaltybwunit == "%")
+ $factor = $lanbw/100;
+ else
+ $factor = wizard_get_bandwidthtype_scale($penaltybwunit);
+ $remainbw += floatval($penaltybw) * $factor;
+ } else {
+ $penalty = false;
+ $penaltybw = 0;
+ }
+ if ($config['ezshaper']['step5']['enable']) {
+ $p2p = true;
+ if ($config['ezshaper']['step5']['p2pcatchall']) {
+ $p2pcatchall = true;
+ $p2pcatchbw = $config['ezshaper']['step5']['bandwidth'];
+ $p2pcatchbwunit = $config['ezshaper']['step5']['bandwidthunit'];
+ if ($p2pcatchbwunit == "%")
+ $factor = $upbw/100;
+ else
+ $factor = wizard_get_bandwidthtype_scale($p2pcatchbwunit);
+ $remainbw += floatval($p2pcatchbw) * $factor;
} else {
- $p2p = false;
$p2pcatchall = false;
$p2pcatchbw = 0;
}
- if ($config['ezshaper']['step6']['enable']) {
- $games = true;
- } else {
- $games = false;
- }
-
- if ($config['ezshaper']['step7']['enable']) {
- $otherpriority = true;
- } else {
- $otherpriority = false;
- }
- $remainbw = round($remainbw / $lanbw * 100, 2);
-
- if (intval($remainbw) > 0 && intval($remainbw) > 40) {
- $savemsg=gettext("Custom Bandwidths are greater than 30%. Please lower them for the wizard to continue.");
- header("Location: wizard.php?xml=traffic_shaper_wizard_multi_all.xml&stepid=2&message={$savemsg}");
- exit;
- } else {
- $remainbw = 100 - $remainbw;
- }
+ } else {
+ $p2p = false;
+ $p2pcatchall = false;
+ $p2pcatchbw = 0;
+ }
+ if ($config['ezshaper']['step6']['enable']) {
+ $games = true;
+ } else {
+ $games = false;
+ }
- if ($sched != "PRIQ") {
- if ($sched == "CBQ")
+ if ($config['ezshaper']['step7']['enable']) {
+ $otherpriority = true;
+ } else {
+ $otherpriority = false;
+ }
+ $remainbw = round($remainbw / $lanbw * 100, 2);
+
+ if (intval($remainbw) > 0 && intval($remainbw) > 40) {
+ $savemsg=gettext("Custom Bandwidths are greater than 30%. Please lower them for the wizard to continue.");
+ header("Location: wizard.php?xml=traffic_shaper_wizard_multi_all.xml&stepid=2&message={$savemsg}");
+ exit;
+ } else {
+ $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'] = "qLink";
+ $tmpcf['priority'] = 1;
+ $tmpcf['enabled'] = "on";
+ $tmpcf['default'] = "on";
+ $tmpcf['ecn'] = "on";
+ if ($sched == "CBQ") {
+ $tmpcf['borrow'] = "on";
+ $tmpcf['bandwidth'] = 20; /* 20% bandwidth */
+ $tmpcf['bandwidthtype'] = "%";
+ } else if ($sched == "HFSC") {
+ $tmpcf['bandwidth'] = 20; /* 20% bandwidth */
+ $tmpcf['bandwidthtype'] = "%";
+ }
+ array_push($tmppath, $tmpcf['name']);
+ $qtmp =& $altq->add_queue($q, &$tmpcf, &$tmppath, $input_errors);
+ array_pop($tmppath);
+ //echo "qDefault <br />";
+ //var_dump($input_errors);
+ $qtmp->wconfig();
+
+ if ($sched != "PRIQ") {
+ if ($sched == "CBQ")
$q =& new cbq_queue();
else if ($sched == "HFSC")
$q =& new hfsc_queue();
@@ -1191,7 +1218,7 @@ function apply_all_choosen_items() {
else if ($sched == "CBQ")
$q =& new cbq_queue();
else if ($sched == "HFSC")
- $q =& new hfsc_queue();
+ $q =& new hfsc_queue();
$tmpcf = array();
$tmpcf['name'] = "qACK";
$tmpcf['priority'] = 6;
@@ -1216,37 +1243,6 @@ function apply_all_choosen_items() {
//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();
- if ($p2pcatchall)
- $tmpcf['name'] = "qOthersDefault";
- else
- $tmpcf['name'] = "qDefault";
- $tmpcf['priority'] = 3;
- $tmpcf['enabled'] = "on";
- if (!$p2pcatchall)
- $tmpcf['default'] = "on";
- $tmpcf['ecn'] = "on";
- if ($sched == "CBQ") {
- $tmpcf['borrow'] = "on";
- $tmpcf['bandwidth'] = $remainbw * 0.1; /* 10% bandwidth */
- $tmpcf['bandwidthtype'] = "%";
- } else if ($sched == "HFSC") {
- $tmpcf['bandwidth'] = $remainbw * 0.1; /* 10% bandwidth */
- $tmpcf['bandwidthtype'] = "%";
- }
- array_push($tmppath, $tmpcf['name']);
- $qtmp =& $altq->add_queue($q, &$tmpcf, &$tmppath, $input_errors);
- array_pop($tmppath);
- //echo "qDefault <br />";
- //var_dump($input_errors);
- $qtmp->wconfig();
-
if ($p2p) {
if ($sched == "PRIQ")
$q =& new priq_queue();
@@ -1272,7 +1268,7 @@ function apply_all_choosen_items() {
$tmpcf['bandwidth'] = $p2pcatchbw;
$tmpcf['bandwidthtype'] = $p2pcatchbwunit;
}
- $tmpcf['default'] = "on";
+ //$tmpcf['default'] = "on";
} else {
if ($sched == "CBQ") {
OpenPOWER on IntegriCloud