diff options
author | Ermal Luçi <eri@pfsense.org> | 2008-03-17 22:11:54 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2008-03-17 22:11:54 +0000 |
commit | 2e89f64275be061c3d06ba51a84790d00dd391bc (patch) | |
tree | 8631ef4127fc681188080c68049a38741622ca55 /usr/local/www/wizards/traffic_shaper_wizard.inc | |
parent | f9b7608e630e60f074bd9832a39f423aa67eb0de (diff) | |
download | pfsense-2e89f64275be061c3d06ba51a84790d00dd391bc.zip pfsense-2e89f64275be061c3d06ba51a84790d00dd391bc.tar.gz |
* Insert other wizards
1- multi Lan/Wan
2- multi Lan/Wan with dedicated links
* Correct checking and math done during the wizards
Diffstat (limited to 'usr/local/www/wizards/traffic_shaper_wizard.inc')
-rw-r--r-- | usr/local/www/wizards/traffic_shaper_wizard.inc | 66 |
1 files changed, 48 insertions, 18 deletions
diff --git a/usr/local/www/wizards/traffic_shaper_wizard.inc b/usr/local/www/wizards/traffic_shaper_wizard.inc index a97c409..08da4fe 100644 --- a/usr/local/www/wizards/traffic_shaper_wizard.inc +++ b/usr/local/www/wizards/traffic_shaper_wizard.inc @@ -923,12 +923,24 @@ $othersplist = array(); $voip = true; $voipbw = $config['ezshaper']['step3']["conn{$i}upload"]; $voipbwunit = $config['ezshaper']['step3']["conn{$i}uploadspeed"]; + if ($sched != "HFSC") { + if ($voipbwunit == "%") + $factor = $upbw/100; + else + $factor = wizard_get_bandwidthtype_scale($voipbwunit); + $remainbw += $voipbw * $factor; + } else + $remainbw += 32000; /* 32Kbit/s forHFSC linksharing */ } if ($config['ezshaper']['step4']['enable']) { $penalty = true; $penaltybw = $config['ezshaper']['step4']['bandwidth']; $penaltybwunit = $config['ezshaper']['step4']['bandwidthunit']; - $remainbw += floatval($config['ezshaper']['step4']['bandwidth']) * $config['ezshaper']['step4']['bandwidthunit']; + if ($penaltybwunit == "%") + $factor = $upbw/100; + else + $factor = wizard_get_bandwidthtype_scale($penaltybwunit); + $remainbw += $penaltybw * $factor; } else { $penalty = false; $penaltybw = 0; @@ -939,7 +951,11 @@ $othersplist = array(); $p2pcatchall = true; $p2pcatchbw = $config['ezshaper']['step5']['bandwidth']; $p2pcatchbwunit = $config['ezshaper']['step5']['bandwidthunit']; - $remainbw += floatval($config['ezshaper']['step5']['bandwidth']) * $config['ezshaper']['step5']['bandwidthunit']; + if ($p2pcatchbwunit == "%") + $factor = $upbw/100; + else + $factor = wizard_get_bandwidthtype_scale($p2pcatchbwunit); + $remainbw += $p2pcatchbw * $factor; } else { $p2pcatchall = false; $p2pcatchbw = 0; @@ -961,13 +977,15 @@ $othersplist = array(); $otherpriority = false; } $remainbw = round($remainbw / $upbw * 100, 2); + /* if ($remainbw > 0 && $remainbw > 30) { $message=gettext("Custom Bandwidths are greater than 30%. Please lower them for the wizard to continue."); header("Location: wizard.php?xml=traffic_shaper_wizard.xml&stepid=2&message={$message}"); exit; } else { + */ $remainbw = 100 - $remainbw; - } + //} if ($sched == "PRIQ") $q =& new priq_queue(); @@ -986,10 +1004,7 @@ $othersplist = array(); $tmpcf['bandwidthtype'] = "%"; } else if ($sched == "HFSC") { - if ($ifbw > 0) - $lkbw = 0.20 * $remainbw; - else - $lkbw = 25; + $lkbw = 0.20 * $remainbw; $tmpcf['linkshare3'] = "{$lkbw}%"; $tmpcf['linkshare2'] = 100; $tmpcf['linkshare1'] = "0b"; @@ -1119,9 +1134,9 @@ $othersplist = array(); } $tmpcf['realtime'] = "on"; $tmpcf['realtime2'] = "10"; - $tmpcf['bandwidth'] = 20; + $tmpcf['bandwidth'] = 32; $tmpcf['realtime1'] = "0b"; - $tmpcf['bandwidthtype'] = "%"; + $tmpcf['bandwidthtype'] = "Kb"; } array_push($tmppath, "qVoIP"); $qtmp =& $altq->add_queue($q, &$tmpcf, &$tmppath, $input_errors); @@ -1276,12 +1291,24 @@ $othersplist = array(); $voip = true; $voipbw = $config['ezshaper']['step3']["download"]; $voipbwunit = $config['ezshaper']['step3']["downloadspeed"]; + if ($sched != "HFSC") { + if ($voipbwunit == "%") + $factor = $upbw/100; + else + $factor = wizard_get_bandwidthtype_scale($voipbwunit); + $remainbw += $voipbw * $factor; + } else + $remainbw += 32000; /* 32Kbit/s forHFSC linksharing */ } if ($config['ezshaper']['step4']['enable']) { $penalty = true; $penaltybw = $config['ezshaper']['step4']['bandwidth']; $penaltybwunit = $config['ezshaper']['step4']['bandwidthunit']; - $remainbw += floatval($config['ezshaper']['step4']['bandwidth']) * $config['ezshaper']['step4']['bandwidthunit']; + if ($penaltybwunit == "%") + $factor = $upbw/100; + else + $factor = wizard_get_bandwidthtype_scale($penaltybwunit); + $remainbw += $penaltybw * $factor; } else { $penalty = false; $penaltybw = 0; @@ -1292,7 +1319,11 @@ $othersplist = array(); $p2pcatchall = true; $p2pcatchbw = $config['ezshaper']['step5']['bandwidth']; $p2pcatchbwunit = $config['ezshaper']['step5']['bandwidthunit']; - $remainbw += floatval($config['ezshaper']['step5']['bandwidth']) * $config['ezshaper']['step5']['bandwidthunit']; + if ($p2pcatchbwunit == "%") + $factor = $upbw/100; + else + $factor = wizard_get_bandwidthtype_scale($p2pcatchbwunit); + $remainbw += $p2pcatchbw * $factor; } else { $p2pcatchall = false; $p2pcatchbw = 0; @@ -1314,13 +1345,15 @@ $othersplist = array(); $otherpriority = false; } $remainbw = round($remainbw / $lanbw * 100, 2); + /* if ($remainbw > 0 && $remainbw > 30) { $message=gettext("Custom Bandwidths are greater than 30%. Please lower them for the wizard to continue."); header("Location: wizard.php?xml=traffic_shaper_wizard.xml&stepid=2&message={$message}"); exit; } else { + */ $remainbw = 100 - $remainbw; - } + //} if ($sched == "PRIQ") $q =& new priq_queue(); @@ -1339,10 +1372,7 @@ $othersplist = array(); $tmpcf['bandwidthtype'] = "%"; } else if ($sched == "HFSC") { - if ($ifbw > 0) - $lkbw = 0.20 * $remainbw; - else - $lkbw = 25; + $lkbw = 0.20 * $remainbw; $tmpcf['linkshare3'] = "{$lkbw}%"; $tmpcf['linkshare2'] = 100; $tmpcf['linkshare1'] = "0b"; @@ -1472,9 +1502,9 @@ $othersplist = array(); } $tmpcf['realtime'] = "on"; $tmpcf['realtime2'] = "10"; - $tmpcf['bandwidth'] = 20; + $tmpcf['bandwidth'] = 32; $tmpcf['realtime1'] = "0b"; - $tmpcf['bandwidthtype'] = "%"; + $tmpcf['bandwidthtype'] = "Kb"; } array_push($tmppath, "qVoIP"); $qtmp =& $altq->add_queue($q, &$tmpcf, &$tmppath, $input_errors); |