diff options
author | Ermal <eri@pfsense.org> | 2010-12-22 13:57:45 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2010-12-22 13:59:05 +0000 |
commit | 475c1932c3158a4e9ca718ae3ba2a2eee739ef61 (patch) | |
tree | 0669450e7de32517d8c8b58ae9a5679c8a92130f /usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc | |
parent | d526314b97fbabb2fb4fe65d4986b4d3977041bb (diff) | |
download | pfsense-475c1932c3158a4e9ca718ae3ba2a2eee739ef61.zip pfsense-475c1932c3158a4e9ca718ae3ba2a2eee739ef61.tar.gz |
Use the provided settings even for HFSC scheduler instead of hardcoding 32Kbit/s speed on VoIP. Also cleanup some whitespace.
Diffstat (limited to 'usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc')
-rw-r--r-- | usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc | 77 |
1 files changed, 37 insertions, 40 deletions
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 4bf3998..44d5314 100644 --- a/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc +++ b/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc @@ -458,45 +458,42 @@ function apply_all_choosen_items() { $upbw = floatval($config['ezshaper']['step2']["conndownload"]) * $upfactor; if ($config['ezshaper']['step3']['enable']) { - $voip = true; - $voipbw = $config['ezshaper']['step3']["conndownload"]; - $voipbwunit = $config['ezshaper']['step3']["conndownloadspeed"]; - 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 */ + $voip = true; + $voipbw = $config['ezshaper']['step3']["conndownload"]; + $voipbwunit = $config['ezshaper']['step3']["conndownloadspeed"]; + if ($voipbwunit == "%") + $factor = $upbw/100; + else + $factor = wizard_get_bandwidthtype_scale($voipbwunit); + $remainbw += $voipbw * $factor; } if ($config['ezshaper']['step4']['enable']) { - $penalty = true; - $penaltybw = $config['ezshaper']['step4']['bandwidth']; - $penaltybwunit = $config['ezshaper']['step4']['bandwidthunit']; - if ($penaltybwunit == "%") - $factor = $upbw/100; - else - $factor = wizard_get_bandwidthtype_scale($penaltybwunit); - $remainbw += $penaltybw * $factor; + $penalty = true; + $penaltybw = $config['ezshaper']['step4']['bandwidth']; + $penaltybwunit = $config['ezshaper']['step4']['bandwidthunit']; + if ($penaltybwunit == "%") + $factor = $upbw/100; + else + $factor = wizard_get_bandwidthtype_scale($penaltybwunit); + $remainbw += $penaltybw * $factor; } else { - $penalty = false; - $penaltybw = 0; + $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 += $p2pcatchbw * $factor; + $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 += $p2pcatchbw * $factor; } else { - $p2pcatchall = false; - $p2pcatchbw = 0; + $p2pcatchall = false; + $p2pcatchbw = 0; } } else { $p2p = false; @@ -1350,19 +1347,19 @@ function apply_all_choosen_items() { function wizard_get_bandwidthtype_scale($type = "b") { switch ($type) { - case "Gb": + case "Gb": $factor = 1024 * 1024 * 1024; - break; - case "Mb": + break; + case "Mb": $factor = 1024 * 1024; - break; - case "Kb": + break; + case "Kb": $factor = 1024; - break; - case "b": - default: + break; + case "b": + default: $factor = 1; - break; + break; } return intval($factor); } |