if ($qossettings{'DOLEVEL7'} eq $Lang::tr{'save'})
{
if ( $qossettings{'QIP'} ne '' ) {
- unless ( &General::validip($qossettings{'QIP'}) ) {
+ if ((!&General::validipandmask($qossettings{'QIP'})) && (!&General::validip($qossettings{'QIP'}))) {
$qossettings{'VALID'} = 'no';
$message = $Lang::tr{'The source IP address is invalid.'};
}
}
if ( $qossettings{'DIP'} ne '' ) {
- unless ( &General::validip($qossettings{'DIP'}) ) {
+ if ((!&General::validipandmask($qossettings{'DIP'})) && (!&General::validip($qossettings{'DIP'}))) {
$qossettings{'VALID'} = 'no';
$message = $Lang::tr{'The destination IP address is invalid.'};
}
if ($qossettings{'DOPORT'} eq $Lang::tr{'save'})
{
if ( $qossettings{'QIP'} ne '' ) {
- unless ( &General::validip($qossettings{'QIP'}) ) {
+ if ((!&General::validipandmask($qossettings{'QIP'})) && (!&General::validip($qossettings{'QIP'}))) {
$qossettings{'VALID'} = 'no';
- $message = "$Lang::tr{'The source IP address is invalid.'}";
+ $message = $Lang::tr{'The source IP address is invalid.'};
}
}
if ( $qossettings{'DIP'} ne '' ) {
- unless ( &General::validip($qossettings{'DIP'}) ) {
+ if ((!&General::validipandmask($qossettings{'DIP'})) && (!&General::validip($qossettings{'DIP'}))) {
$qossettings{'VALID'} = 'no';
- $message = "$Lang::tr{'The destination IP address is invalid.'}";
+ $message = $Lang::tr{'The destination IP address is invalid.'};
}
}
if ($qossettings{'CLASS'} >= 100 && $qossettings{'CLASS'} < 121) {
$qossettings{'ENABLED'} = 'on';
&General::writehash("${General::swroot}/qos/settings", \%qossettings);
system("/usr/local/bin/qosctrl generate >/dev/null 2>&1");
- system("/usr/bin/touch /var/ipfire/qos/enable");
system("/usr/local/bin/qosctrl start >/dev/null 2>&1");
system("logger -t ipfire 'QoS started'");
}
elsif ($qossettings{'ACTION'} eq $Lang::tr{'stop'})
{
- system("/usr/local/bin/qosctrl stop >/dev/null 2>&1");
- unlink "/var/ipfire/qos/bin/qos.sh";
- unlink "/var/ipfire/qos/enable";
- system("logger -t ipfire 'QoS stopped'");
$qossettings{'ENABLED'} = 'off';
&General::writehash("${General::swroot}/qos/settings", \%qossettings);
+ system("/usr/local/bin/qosctrl stop >/dev/null 2>&1");
+ system("/usr/local/bin/qosctrl generate >/dev/null 2>&1");
+ system("logger -t ipfire 'QoS stopped'");
}
elsif ($qossettings{'ACTION'} eq $Lang::tr{'restart'})
{
}
open( FILE, "> $classfile" ) or die "Unable to write $classfile";
print FILE <<END
-imq0;200;1;$DOWN[10];$DOWN[1];;;8;VoIP;
+imq0;200;1;$DOWN[20];$DOWN[1];;;8;VoIP;
imq0;203;4;$DOWN[20];$DOWN[1];;;0;VPN;
imq0;204;5;$DOWN[20];$DOWN[1];;;8;Webtraffic;
imq0;210;6;1;$DOWN[1];;;0;Default;
imq0;220;7;1;$DOWN[1];;;1;P2P;
-$qossettings{'RED_DEV'};101;1;$UP[2];$UP[1];;;8;ACKs;
-$qossettings{'RED_DEV'};102;2;$UP[3];$UP[1];;;8;VoIP;
+$qossettings{'RED_DEV'};101;1;$UP[10];$UP[1];;;8;ACKs;
+$qossettings{'RED_DEV'};102;2;$UP[10];$UP[1];;;8;VoIP;
+$qossettings{'RED_DEV'};103;4;$UP[10];$UP[1];;;2;VPN;
$qossettings{'RED_DEV'};104;5;$UP[10];$UP[1];;;8;Webtraffic;
$qossettings{'RED_DEV'};110;6;1;$UP[1];;;0;Default;
$qossettings{'RED_DEV'};120;7;1;$UP[1];;;1;P2P;
-$qossettings{'RED_DEV'};103;4;$UP[2];$UP[1];;;2;VPN;
END
;
close FILE;
$qossettings{'ENABLED'} = 'on';
&General::writehash("${General::swroot}/qos/settings", \%qossettings);
system("/usr/local/bin/qosctrl generate >/dev/null 2>&1");
- system("/usr/bin/touch /var/ipfire/qos/enable");
system("/usr/local/bin/qosctrl start >/dev/null 2>&1");
system("logger -t ipfire 'QoS started'");
} else {
}
&Header::openbox('100%', 'center', "$qossettings{'RED_DEV'} $Lang::tr{'graph'}, $Lang::tr{'uplink'}");
- &Graphs::makegraphbox("qos.cgi",$qossettings{'RED_DEV'},"hour","325");
+ &Graphs::makegraphbox("qos.cgi",$qossettings{'RED_DEV'},"hour");
&Header::closebox();
&Header::openbox('100%', 'center', "$qossettings{'IMQ_DEV'} $Lang::tr{'graph'}, $Lang::tr{'downlink'}");
- &Graphs::makegraphbox("qos.cgi",$qossettings{'IMQ_DEV'},"hour","325");
+ &Graphs::makegraphbox("qos.cgi",$qossettings{'IMQ_DEV'},"hour");
&Header::closebox();
&showclasses($qossettings{'RED_DEV'});
<tr><td width='33%' align='right'>$Lang::tr{'guaranteed bandwith'}:
<td width='33%' align='left'><input type='text' size='20' name='MINBWDTH' maxlength='8' required='1' value="$qossettings{'MINBWDTH'}" />
<td width='33%' align='center'>
- <tr><td width='33%' align='right'>$Lang::tr{'max bandwith'}:
+ <tr><td width='33%' align='right'>$Lang::tr{'max bandwith'} <img src='/blob.gif' alt='*' />:
<td width='33%' align='left'><input type='text' size='20' name='MAXBWDTH' maxlength='8' required='1' value="$qossettings{'MAXBWDTH'}" />
<td width='33%' align='center'>
<tr><td width='33%' align='right'>Burst:
<option value='1' $selected{'TOS'}{'1'}>$Lang::tr{'min costs'} (1)</option></select>
<td width='33%' align='center'>
<tr><td width='33%' align='right'>$Lang::tr{'remark'}:
- <td width='66%' colspan='2' align='left'><input type='text' name='REMARK' size='40' maxlength='40' value="$qossettings{'REMARK'}" /> <img alt="" alt='blob' src='/blob.gif' />
- <tr><td width='33%' align='right'>
+ <td width='66%' colspan='2' align='left'><input type='text' name='REMARK' size='40' maxlength='40' value="$qossettings{'REMARK'}" />
+ <tr><td width='33%' align='right'><img src='/blob.gif' alt='*' /> $Lang::tr{'required field'}
<td width='33%' align='left'>
<td width='33%' align='center'><input type='submit' name='DOCLASS' value='$Lang::tr{'save'}' /> <input type='reset' value='$Lang::tr{'reset'}' />
</table></form>
print <<END
</select><td width='33%' align='center'>
<tr><td width='33%' align='right'>$Lang::tr{'source ip'}:
- <td width='33%' align='left'><input type='text' name='QIP' maxlength='15' value='$qossettings{'QIP'}' />
+ <td width='33%' align='left'><input type='text' name='QIP' maxlength='31' value='$qossettings{'QIP'}' />
<td width='33%' align='center'>
<tr><td width='33%' align='right'>$Lang::tr{'destination ip'}:
- <td width='33%' align='left'><input type='text' name='DIP' maxlength='15' value='$qossettings{'DIP'}' />
+ <td width='33%' align='left'><input type='text' name='DIP' maxlength='31' value='$qossettings{'DIP'}' />
<td width='33%' align='center'><input type='hidden' name='CLASS' value='$qossettings{'CLASS'}' /><input type='submit' name='DOLEVEL7' value='$Lang::tr{'save'}' />
<tr><td colspan="3" align='center'><font color="red"><em>$Lang::tr{'qos warning'}</em></font>
</table></form>
<td width='33%' align='left'><input type='text' name='DPORT' maxlength='11' value='$qossettings{'DPORT'}' />
<td width='33%' align='center'>
<tr><td width='33%' align='right'>$Lang::tr{'source ip'}:
- <td width='33%' align='left'><input type='text' name='QIP' maxlength='15' value='$qossettings{'QIP'}' />
+ <td width='33%' align='left'><input type='text' name='QIP' maxlength='31' value='$qossettings{'QIP'}' />
<td width='33%' align='center'>
<tr><td width='33%' align='right'>$Lang::tr{'destination ip'}:
- <td width='33%' align='left'><input type='text' name='DIP' maxlength='15' value='$qossettings{'DIP'}' />
+ <td width='33%' align='left'><input type='text' name='DIP' maxlength='31' value='$qossettings{'DIP'}' />
<td width='33%' align='center'><input type='hidden' name='CLASS' value='$qossettings{'CLASS'}' /><input type='submit' name='DOPORT' value='$Lang::tr{'save'}' />
</table></form>
END