]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - html/cgi-bin/qos.cgi
httpd: include TLS 1.3 cipher suites
[ipfire-2.x.git] / html / cgi-bin / qos.cgi
index dee6f41bd014ee45d17f5a7939908c7fbb3501c1..b7af11204ebd29c9cf20145e5e0c84e76cd3d567 100644 (file)
@@ -251,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.'};
                }
@@ -326,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) {
@@ -463,18 +463,16 @@ if ($qossettings{'ACTION'} eq $Lang::tr{'start'})
        $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'})
 {
@@ -512,17 +510,17 @@ elsif ($qossettings{'ACTION'} eq $Lang::tr{'template'} )
                }
                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;
@@ -587,7 +585,6 @@ END
                $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 {
@@ -773,10 +770,10 @@ if ( ($qossettings{'DEFCLASS_INC'} eq '') || ($qossettings{'DEFCLASS_OUT'} eq ''
 }
 
        &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'});
@@ -938,7 +935,7 @@ END
                <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'>&nbsp;
-               <tr><td width='33%' align='right'>$Lang::tr{'max bandwith'}:
+               <tr><td width='33%' align='right'>$Lang::tr{'max bandwith'}&nbsp;<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'>&nbsp;
                <tr><td width='33%' align='right'>Burst:
@@ -960,8 +957,8 @@ print <<END
                                <option value='1' $selected{'TOS'}{'1'}>$Lang::tr{'min costs'} (1)</option></select>
                    <td width='33%' align='center'>&nbsp;
                <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'>&nbsp;
+                   <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='*' />&nbsp;$Lang::tr{'required field'}
                    <td width='33%' align='left'>&nbsp;
                    <td width='33%' align='center'><input type='submit' name='DOCLASS' value='$Lang::tr{'save'}' />&nbsp;<input type='reset' value='$Lang::tr{'reset'}' />
                </table></form>
@@ -1079,10 +1076,10 @@ END
        print <<END
                    </select><td width='33%' align='center'>&nbsp;
                <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'>&nbsp;
                <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>
@@ -1123,10 +1120,10 @@ END
                    <td width='33%' align='left'><input type='text' name='DPORT' maxlength='11' value='$qossettings{'DPORT'}' />
                    <td width='33%' align='center'>&nbsp;
                <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'>&nbsp;
                <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