]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - html/cgi-bin/qos.cgi
QOS: IP-Addresses can now be simple IP-Address or IP-Address and subnet
[people/teissler/ipfire-2.x.git] / html / cgi-bin / qos.cgi
index f3539cd9b1ae1d7038e0a6c33a0e1ad1187f2588..6d4d025bfdbc228283fe472127bcf3d521e61394 100644 (file)
@@ -251,15 +251,29 @@ END
 if ($qossettings{'DOLEVEL7'} eq $Lang::tr{'save'})
 {
        if ( $qossettings{'QIP'} ne '' ) {
-               unless ( &General::validip($qossettings{'QIP'}) ) {
-                       $qossettings{'VALID'} = 'no';
-                       $message = $Lang::tr{'The source IP address is invalid.'};
+               if ($qossettings{'QIP'} =~ /^(.*?)\/(.*?)$/){
+                       if (! &General::validipandmask($qossettings{'QIP'}) ) {
+                               $qossettings{'VALID'} = 'no';
+                               $message = $Lang::tr{'The source IP address is invalid.'};
+                       }
+               }else{
+                       if ( &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'}) ) {
-                       $qossettings{'VALID'} = 'no';
-                       $message = $Lang::tr{'The destination IP address is invalid.'};
+               if ($qossettings{'QIP'} =~ /^(.*?)\/(.*?)$/){
+                       if ( &General::validipandmask($qossettings{'DIP'}) ) {
+                               $qossettings{'VALID'} = 'no';
+                               $message = $Lang::tr{'The destination IP address is invalid.'};
+                       }
+               }else{
+                       if ( &General::validip($qossettings{'DIP'}) ) {
+                               $qossettings{'VALID'} = 'no';
+                               $message = $Lang::tr{'The destination IP address is invalid.'};
+                       }
                }
        }
        if ($qossettings{'CLASS'} >= 100 && $qossettings{'CLASS'} < 121) {
@@ -772,10 +786,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();
 
@@ -1079,10 +1093,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 +1137,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
@@ -1184,7 +1198,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 <<END
                                <table border='0' width='100%' cellspacing='0'>
                                <tr><td bgcolor='$color{'color20'}' width='10%' align='center'><b>$Lang::tr{'interface'}</b>