X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=html%2Fcgi-bin%2Fqos.cgi;h=5542f65309d7863e9f14489d73cde0373f6d1658;hb=c2a1af7545c52edc9354e778acecb6370ea15d48;hp=844058de3276cf249dde5669ce9603576b326f14;hpb=44f8687ba29b06b012a01c36abe51ffdba27287d;p=people%2Fteissler%2Fipfire-2.x.git diff --git a/html/cgi-bin/qos.cgi b/html/cgi-bin/qos.cgi index 844058de3..5542f6530 100644 --- a/html/cgi-bin/qos.cgi +++ b/html/cgi-bin/qos.cgi @@ -73,9 +73,6 @@ $qossettings{'DEF_INC_SPD'} = ''; $qossettings{'DEFCLASS_INC'} = ''; $qossettings{'DEFCLASS_OUT'} = ''; $qossettings{'ACK'} = ''; -$qossettings{'MTU'} = '1492'; -$qossettings{'SFQ_PERTUB'} = '10'; -$qossettings{'QLENGTH'} = '30'; $qossettings{'RED_DEV'} = 'ppp0'; $qossettings{'IMQ_DEV'} = 'imq0'; $qossettings{'VALID'} = 'yes'; @@ -254,13 +251,13 @@ END 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.'}; } @@ -329,15 +326,15 @@ END 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) { @@ -500,20 +497,21 @@ elsif ($qossettings{'ACTION'} eq $Lang::tr{'save'}) } elsif ($qossettings{'ACTION'} eq $Lang::tr{'template'} ) { - my @UP; - #print "UP
"; - for(my $i = 1; $i <= 10; $i++) { - $UP[$i] = int($qossettings{'OUT_SPD'} / $i ); - #print $i."=".$UP[$i]." "; - } - my @DOWN; - #print "

Down
"; - for(my $i = 1; $i <= 20; $i++) { - $DOWN[$i] = int($qossettings{'INC_SPD'} / $i); - #print $i."=".$DOWN[$i]." "; - } - open( FILE, "> $classfile" ) or die "Unable to write $classfile"; - print FILE < 0) && ($qossettings{'INC_SPD'} > 0)) { + my @UP; + #print "UP
"; + for(my $i = 1; $i <= 10; $i++) { + $UP[$i] = int($qossettings{'OUT_SPD'} / $i ); + #print $i."=".$UP[$i]." "; + } + my @DOWN; + #print "

Down
"; + for(my $i = 1; $i <= 20; $i++) { + $DOWN[$i] = int($qossettings{'INC_SPD'} / $i); + #print $i."=".$DOWN[$i]." "; + } + open( FILE, "> $classfile" ) or die "Unable to write $classfile"; + print FILE < $level7file" ) or die "Unable to write $level7file"; - print FILE < $level7file" ) or die "Unable to write $level7file"; + print FILE < $portfile" ) or die "Unable to write $portfile"; - print FILE < $portfile" ) or die "Unable to write $portfile"; + print FILE </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 { + $message = $Lang::tr{'qos enter bandwidths'}; } - $qossettings{'DEFCLASS_INC'} = "210"; - $qossettings{'DEFCLASS_OUT'} = "110"; - $qossettings{'ACK'} ="101"; - $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{'status'} ) { @@ -660,13 +661,6 @@ END &Header::closepage(); exit } -elsif ($qossettings{'ACTION'} eq "$Lang::tr{'urlfilter advanced settings'}" ) -{ - &expert(); - &Header::closebigbox(); - &Header::closepage(); - exit -} if ($qossettings{'ACTIONBW'} eq "$Lang::tr{'modify'}" ) { &changebandwidth(); @@ -705,7 +699,7 @@ if ($errormessage) { ############################################################################################################################ ############################################################################################################################ -&Header::openbox('100%', 'center', 'Quality of Service'); +&Header::openbox('100%', 'center', ); print < @@ -713,15 +707,18 @@ print <$message"; + print "$message"; } print <Quality of Service: - $status - - - - + Quality of Service: + $status + +
+ + + + + END ; if (($qossettings{'OUT_SPD'} ne '') && ($qossettings{'INC_SPD'} ne '')) { @@ -750,11 +747,11 @@ END
- -
- - -
+ +
+ + +
END ; @@ -775,10 +772,10 @@ if ( ($qossettings{'DEFCLASS_INC'} eq '') || ($qossettings{'DEFCLASS_OUT'} eq '' exit } - &Header::openbox('100%', 'center', "$qossettings{'RED_DEV'} $Lang::tr{'graph'}"); + &Header::openbox('100%', 'center', "$qossettings{'RED_DEV'} $Lang::tr{'graph'}, $Lang::tr{'uplink'}"); &Graphs::makegraphbox("qos.cgi",$qossettings{'RED_DEV'},"hour","325"); &Header::closebox(); - &Header::openbox('100%', 'center', "$qossettings{'IMQ_DEV'} $Lang::tr{'graph'}"); + &Header::openbox('100%', 'center', "$qossettings{'IMQ_DEV'} $Lang::tr{'graph'}, $Lang::tr{'downlink'}"); &Graphs::makegraphbox("qos.cgi",$qossettings{'IMQ_DEV'},"hour","325"); &Header::closebox(); @@ -799,7 +796,7 @@ sub changedefclasses {
$Lang::tr{'no filter pass'} -
Download:
$Lang::tr{'download'}:  -
Upload:
$Lang::tr{'upload'}: 
$Lang::tr{'source ip'}: - +  
$Lang::tr{'destination ip'}: - +
$Lang::tr{'qos warning'}
@@ -1126,10 +1123,10 @@ END   $Lang::tr{'source ip'}: - +   $Lang::tr{'destination ip'}: - + END @@ -1187,7 +1184,7 @@ sub showclasses { @classline = split( /\;/, $classentry ); if ( $classline[0] eq $qossettings{'DEV'} ) { - &Header::openbox('100%', 'center', "$Lang::tr{'Class'}: $classline[1]"); + &Header::openbox('100%', 'center', "$Lang::tr{'Class'}: $classline[1] $classline[8]"); print < $Lang::tr{'interface'} @@ -1212,22 +1209,22 @@ sub showclasses {
- +
- +
- +
- +
@@ -1252,13 +1249,13 @@ END - +
- +
END @@ -1317,7 +1314,7 @@ END - +
@@ -1327,7 +1324,7 @@ END - +
END @@ -1375,14 +1372,14 @@ END - +
- +
END @@ -1410,17 +1407,17 @@ END
- +
- +
- +
END @@ -1436,29 +1433,6 @@ END } } } - -sub expert -{ - &Header::openbox('100%', 'center', $Lang::tr{'expertoptions'}); - print < - -
MTU: - - $Lang::tr{'mtu QoS'} -
$Lang::tr{'Queuelenght'}: - -   -
SFQ Perturb: - - -
- -END -; - &Header::closebox(); -} - sub validminbwdth { if ( $qossettings{'VALID'} eq 'yes' ) { if ( $qossettings{'DEVICE'} eq $qossettings{'RED_DEV'} ) {