Project

General

Profile

« Previous | Next » 

Revision 10e93284

Added by Jim Pingle over 7 years ago

Unbreak PRIQ queue creation for VoIP, Penalty Box, and P2P options. Fixes #7913

View differences:

src/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc
704 704
		$upfactor = wizard_get_bandwidthtype_scale($config['ezshaper']['step2']["conn{$i}uploadspeed"]);
705 705
		$upbw = floatval($config['ezshaper']['step2']["conn{$i}upload"]) * $upfactor;
706 706

  
707
		if ($sched != "PRIQ" && $config['ezshaper']['step3']['enable']) {
707
		if ($config['ezshaper']['step3']['enable']) {
708 708
			$voip = true;
709
			$voipbw = $config['ezshaper']['step3']["conn{$i}upload"];
710
			$voipbwunit = $config['ezshaper']['step3']["conn{$i}uploadspeed"];
711
			if ($voipbwunit == "%")
712
				$factor =  $upbw/100;
713
			else
714
				$factor = wizard_get_bandwidthtype_scale($voipbwunit);
715
			$remainbw += $voipbw * $factor;
709
			if ($sched != "PRIQ") {
710
				$voipbw = $config['ezshaper']['step3']["conn{$i}upload"];
711
				$voipbwunit = $config['ezshaper']['step3']["conn{$i}uploadspeed"];
712
				if ($voipbwunit == "%")
713
					$factor =  $upbw/100;
714
				else
715
					$factor = wizard_get_bandwidthtype_scale($voipbwunit);
716
				$remainbw += $voipbw * $factor;
717
			}
716 718
		}
717
		if ($sched != "PRIQ" && $config['ezshaper']['step4']['enable']) {
719
		if ($config['ezshaper']['step4']['enable']) {
718 720
			$penalty = true;
719
			$penaltybw = $config['ezshaper']['step4']['bandwidth'];
720
			$penaltybwunit = $config['ezshaper']['step4']['bandwidthunit'];
721
			if ($penaltybwunit == "%")
722
				$factor = $upbw/100;
723
			else
724
				$factor = wizard_get_bandwidthtype_scale($penaltybwunit);
725
			$remainbw += $penaltybw * $factor;
721
			if ($sched != "PRIQ") {
722
				$penaltybw = $config['ezshaper']['step4']['bandwidth'];
723
				$penaltybwunit = $config['ezshaper']['step4']['bandwidthunit'];
724
				if ($penaltybwunit == "%")
725
					$factor = $upbw/100;
726
				else
727
					$factor = wizard_get_bandwidthtype_scale($penaltybwunit);
728
				$remainbw += $penaltybw * $factor;
729
			}
726 730
		} else {
727 731
			$penalty = false;
728 732
			$penaltybw = 0;
729 733
		}
730
		if ($sched != "PRIQ" && $config['ezshaper']['step5']['enable']) {
734
		if ($config['ezshaper']['step5']['enable']) {
731 735
			$p2p = true;
732 736
			if ($config['ezshaper']['step5']['p2pcatchall']) {
733 737
				$p2pcatchall = true;
734
				$p2pcatchbw = $config['ezshaper']['step5']['bandwidth'];
735
				$p2pcatchbwunit = $config['ezshaper']['step5']['bandwidthunit'];
736
				if ($p2pcatchbwunit == "%")
737
					$factor = $upbw/100;
738
				else
739
					$factor = wizard_get_bandwidthtype_scale($p2pcatchbwunit);
740
				$remainbw += $p2pcatchbw * $factor;
738
				if ($sched != "PRIQ") {
739
					$p2pcatchbw = $config['ezshaper']['step5']['bandwidth'];
740
					$p2pcatchbwunit = $config['ezshaper']['step5']['bandwidthunit'];
741
					if ($p2pcatchbwunit == "%")
742
						$factor = $upbw/100;
743
					else
744
						$factor = wizard_get_bandwidthtype_scale($p2pcatchbwunit);
745
					$remainbw += $p2pcatchbw * $factor;
746
				}
741 747
			} else {
742 748
				$p2pcatchall = false;
743 749
				$p2pcatchbw = 0;
......
1087 1093
			$otherpriority = false;
1088 1094
			$remainbw = 0;
1089 1095

  
1090
			if ($sched != "PRIQ" && $config['ezshaper']['step3']['enable']) {
1096
			if ($config['ezshaper']['step3']['enable']) {
1091 1097
				$voip = true;
1092
				$voipbw = $config['ezshaper']['step3']["local{$i}download"];
1093
				$voipbwunit = $config['ezshaper']['step3']["local{$i}downloadspeed"];
1094
				if ($sched != HFSC) {
1095
					if ($voipbwunit == "%")
1096
						$factor = $downbw/100;
1097
					else
1098
						$factor = wizard_get_bandwidthtype_scale($voipbwunit);
1099
					$remainbw += floatval($voipbw) * $factor;
1100
				} else
1101
				$remainbw += 32000; /* 32Kbit/s reserved for HFSC link sharing */
1098
				if ($sched != "PRIQ") {
1099
					$voipbw = $config['ezshaper']['step3']["local{$i}download"];
1100
					$voipbwunit = $config['ezshaper']['step3']["local{$i}downloadspeed"];
1101
					if ($sched != HFSC) {
1102
						if ($voipbwunit == "%")
1103
							$factor = $downbw/100;
1104
						else
1105
							$factor = wizard_get_bandwidthtype_scale($voipbwunit);
1106
						$remainbw += floatval($voipbw) * $factor;
1107
					} else
1108
					$remainbw += 32000; /* 32Kbit/s reserved for HFSC link sharing */
1109
				}
1102 1110
			}
1103
			if ($sched != "PRIQ" && $config['ezshaper']['step4']['enable']) {
1111
			if ($config['ezshaper']['step4']['enable']) {
1104 1112
				$penalty = true;
1105
				$penaltybw = $config['ezshaper']['step4']['bandwidth'];
1106
				$penaltybwunit = $config['ezshaper']['step4']['bandwidthunit'];
1107
				if ($penaltybwunit == "%")
1108
					$factor = $downbw/100;
1109
				else
1110
					$factor = wizard_get_bandwidthtype_scale($penaltybwunit);
1111
				$remainbw += floatval($penaltybw) * $factor;
1113
				if ($sched != "PRIQ") {
1114
					$penaltybw = $config['ezshaper']['step4']['bandwidth'];
1115
					$penaltybwunit = $config['ezshaper']['step4']['bandwidthunit'];
1116
					if ($penaltybwunit == "%")
1117
						$factor = $downbw/100;
1118
					else
1119
						$factor = wizard_get_bandwidthtype_scale($penaltybwunit);
1120
					$remainbw += floatval($penaltybw) * $factor;
1121
				}
1112 1122
			} else {
1113 1123
				$penalty = false;
1114 1124
				$penaltybw = 0;
1115 1125
			}
1116
			if ($sched != "PRIQ" && $config['ezshaper']['step5']['enable']) {
1126
			if ($config['ezshaper']['step5']['enable']) {
1117 1127
				$p2p = true;
1118 1128
				if ($config['ezshaper']['step5']['p2pcatchall']) {
1119 1129
					$p2pcatchall = true;
1120
					$p2pcatchbw = $config['ezshaper']['step5']['bandwidth'];
1121
					$p2pcatchbwunit = $config['ezshaper']['step5']['bandwidthunit'];
1122
					if ($p2pcatchbwunit == "%")
1123
						$factor = $downbw/100;
1124
					else
1125
						$factor = wizard_get_bandwidthtype_scale($p2pcatchbwunit);
1126
					$remainbw += floatval($p2pcatchbw) * $factor;
1130
					if ($sched != "PRIQ") {
1131
						$p2pcatchbw = $config['ezshaper']['step5']['bandwidth'];
1132
						$p2pcatchbwunit = $config['ezshaper']['step5']['bandwidthunit'];
1133
						if ($p2pcatchbwunit == "%")
1134
							$factor = $downbw/100;
1135
						else
1136
							$factor = wizard_get_bandwidthtype_scale($p2pcatchbwunit);
1137
						$remainbw += floatval($p2pcatchbw) * $factor;
1138
					}
1127 1139
				} else {
1128 1140
					$p2pcatchall = false;
1129 1141
					$p2pcatchbw = 0;
src/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc
772 772
		$upfactor = wizard_get_bandwidthtype_scale($config['ezshaper']['step2']["conn{$i}uploadspeed"]);
773 773
		$upbw = floatval($config['ezshaper']['step2']["conn{$i}upload"]) * $upfactor;
774 774

  
775
		if ($sched != "PRIQ" && $config['ezshaper']['step3']['enable']) {
775
		if ($config['ezshaper']['step3']['enable']) {
776 776
			$voip = true;
777
			$voipbw = $config['ezshaper']['step3']["conn{$i}upload"];
778
			$voipbwunit = $config['ezshaper']['step3']["conn{$i}uploadspeed"];
779
			if ($voipbwunit == "%")
780
				$factor =  $upbw/100;
781
			else
782
				$factor = wizard_get_bandwidthtype_scale($voipbwunit);
783
			$remainbw += $voipbw * $factor;
777
			if ($sched != "PRIQ") {
778
				$voipbw = $config['ezshaper']['step3']["conn{$i}upload"];
779
				$voipbwunit = $config['ezshaper']['step3']["conn{$i}uploadspeed"];
780
				if ($voipbwunit == "%")
781
					$factor =  $upbw/100;
782
				else
783
					$factor = wizard_get_bandwidthtype_scale($voipbwunit);
784
				$remainbw += $voipbw * $factor;
785
			}
784 786
		}
785
		if ($sched != "PRIQ" && $config['ezshaper']['step4']['enable']) {
787
		if ($config['ezshaper']['step4']['enable']) {
786 788
			$penalty = true;
787
			$penaltybw = $config['ezshaper']['step4']['bandwidth'];
788
			$penaltybwunit = $config['ezshaper']['step4']['bandwidthunit'];
789
			if ($penaltybwunit == "%")
790
				$factor = $upbw/100;
791
			else
792
				$factor = wizard_get_bandwidthtype_scale($penaltybwunit);
793
			$remainbw += $penaltybw * $factor;
789
			if ($sched != "PRIQ") {
790
				$penaltybw = $config['ezshaper']['step4']['bandwidth'];
791
				$penaltybwunit = $config['ezshaper']['step4']['bandwidthunit'];
792
				if ($penaltybwunit == "%")
793
					$factor = $upbw/100;
794
				else
795
					$factor = wizard_get_bandwidthtype_scale($penaltybwunit);
796
				$remainbw += $penaltybw * $factor;
797
			}
794 798
		} else {
795 799
			$penalty = false;
796 800
			$penaltybw = 0;
797 801
		}
798
		if ($sched != "PRIQ" && $config['ezshaper']['step5']['enable']) {
802
		if ($config['ezshaper']['step5']['enable']) {
799 803
			$p2p = true;
800 804
			if ($config['ezshaper']['step5']['p2pcatchall']) {
801 805
				$p2pcatchall = true;
802
				$p2pcatchbw = $config['ezshaper']['step5']['bandwidth'];
803
				$p2pcatchbwunit = $config['ezshaper']['step5']['bandwidthunit'];
804
				if ($p2pcatchbwunit == "%")
805
					$factor = $upbw/100;
806
				else
807
					$factor = wizard_get_bandwidthtype_scale($p2pcatchbwunit);
808
				$remainbw += $p2pcatchbw * $factor;
806
				if ($sched != "PRIQ") {
807
					$p2pcatchbw = $config['ezshaper']['step5']['bandwidth'];
808
					$p2pcatchbwunit = $config['ezshaper']['step5']['bandwidthunit'];
809
					if ($p2pcatchbwunit == "%")
810
						$factor = $upbw/100;
811
					else
812
						$factor = wizard_get_bandwidthtype_scale($p2pcatchbwunit);
813
					$remainbw += $p2pcatchbw * $factor;
814
				}
809 815
			} else {
810 816
				$p2pcatchall = false;
811 817
				$p2pcatchbw = 0;
......
1168 1174
		$otherpriority = false;
1169 1175
		$remainbw = 0;
1170 1176

  
1171
		if ($sched != "PRIQ" && $config['ezshaper']['step3']['enable']) {
1177
		if ($config['ezshaper']['step3']['enable']) {
1172 1178
			$voip = true;
1173
			$voipbw = $config['ezshaper']['step3']["local{$i}download"];
1174
			$voipbwunit = $config['ezshaper']['step3']["local{$i}downloadspeed"];
1175
			if ($sched != HFSC) {
1176
				if ($voipbwunit == "%")
1177
					$factor = $lanbw/100;
1178
				else
1179
					$factor = wizard_get_bandwidthtype_scale($voipbwunit);
1180
				$remainbw += floatval($voipbw) * $factor;
1181
			} else
1182
				$remainbw += 32000; /* 32Kbit/s reserved for HFSC link sharing */
1179
			if ($sched != "PRIQ") {
1180
				$voipbw = $config['ezshaper']['step3']["local{$i}download"];
1181
				$voipbwunit = $config['ezshaper']['step3']["local{$i}downloadspeed"];
1182
				if ($sched != HFSC) {
1183
					if ($voipbwunit == "%")
1184
						$factor = $lanbw/100;
1185
					else
1186
						$factor = wizard_get_bandwidthtype_scale($voipbwunit);
1187
					$remainbw += floatval($voipbw) * $factor;
1188
				} else
1189
					$remainbw += 32000; /* 32Kbit/s reserved for HFSC link sharing */
1190
			}
1183 1191
		}
1184
		if ($sched != "PRIQ" && $config['ezshaper']['step4']['enable']) {
1192
		if ($config['ezshaper']['step4']['enable']) {
1185 1193
			$penalty = true;
1186
			$penaltybw = $config['ezshaper']['step4']['bandwidth'];
1187
			$penaltybwunit = $config['ezshaper']['step4']['bandwidthunit'];
1188
			if ($penaltybwunit == "%")
1189
				$factor = $lanbw/100;
1190
			else
1191
				$factor = wizard_get_bandwidthtype_scale($penaltybwunit);
1192
			$remainbw += floatval($penaltybw) * $factor;
1194
			if ($sched != "PRIQ") {
1195
				$penaltybw = $config['ezshaper']['step4']['bandwidth'];
1196
				$penaltybwunit = $config['ezshaper']['step4']['bandwidthunit'];
1197
				if ($penaltybwunit == "%")
1198
					$factor = $lanbw/100;
1199
				else
1200
					$factor = wizard_get_bandwidthtype_scale($penaltybwunit);
1201
				$remainbw += floatval($penaltybw) * $factor;
1202
			}
1193 1203
		} else {
1194 1204
			$penalty = false;
1195 1205
			$penaltybw = 0;
1196 1206
		}
1197
		if ($sched != "PRIQ" && $config['ezshaper']['step5']['enable']) {
1207
		if ($config['ezshaper']['step5']['enable']) {
1198 1208
			$p2p = true;
1199 1209
			if ($config['ezshaper']['step5']['p2pcatchall']) {
1200 1210
				$p2pcatchall = true;
1201
				$p2pcatchbw = $config['ezshaper']['step5']['bandwidth'];
1202
				$p2pcatchbwunit = $config['ezshaper']['step5']['bandwidthunit'];
1203
				if ($p2pcatchbwunit == "%")
1204
					$factor = $upbw/100;
1205
				else
1206
					$factor = wizard_get_bandwidthtype_scale($p2pcatchbwunit);
1207
				$remainbw += floatval($p2pcatchbw) * $factor;
1211
				if ($sched != "PRIQ") {
1212
					$p2pcatchbw = $config['ezshaper']['step5']['bandwidth'];
1213
					$p2pcatchbwunit = $config['ezshaper']['step5']['bandwidthunit'];
1214
					if ($p2pcatchbwunit == "%")
1215
						$factor = $upbw/100;
1216
					else
1217
						$factor = wizard_get_bandwidthtype_scale($p2pcatchbwunit);
1218
					$remainbw += floatval($p2pcatchbw) * $factor;
1219
				}
1208 1220
			} else {
1209 1221
				$p2pcatchall = false;
1210 1222
				$p2pcatchbw = 0;

Also available in: Unified diff