From e8babc92b0c612fe53d8695bfef871a77f453c32 Mon Sep 17 00:00:00 2001 From: delaco Date: Sat, 23 Sep 2006 17:37:59 +0000 Subject: [PATCH] Fixes fuer den Buildprozess. (applejuice, mysql) Quality of Service: TOS-Regeln und TOS-Matches hinzugefuegt, Graphen uebersichtlicher angeordnet. git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@295 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8 --- config/qos/makeqosscripts.pl | 80 ++++++- doc/packages-list.txt | 1 - html/cgi-bin/qos.cgi | 389 +++++++++++++++++++++++++++------- lfs/applejuice | 3 +- lfs/configroot | 2 +- lfs/mysql | 1 + make.sh | 4 +- src/misc-progs/qosctrl.c | 2 +- src/paks/applejuice/ROOTFILES | 264 +++++++++++------------ 9 files changed, 533 insertions(+), 213 deletions(-) diff --git a/config/qos/makeqosscripts.pl b/config/qos/makeqosscripts.pl index de5804724d..a2bd5add4c 100644 --- a/config/qos/makeqosscripts.pl +++ b/config/qos/makeqosscripts.pl @@ -9,7 +9,7 @@ use strict; # enable only the following on debugging purpose -use warnings; +# use warnings; require '/var/ipfire/general-functions.pl'; require "${General::swroot}/lang.pl"; @@ -26,14 +26,17 @@ my $classentry = ""; my $subclassentry = ""; my $l7ruleentry = ""; my $portruleentry = ""; +my $tosruleentry = ""; my @tmp = (); my @classes = (); my @subclasses = (); my @l7rules = (); my @portrules = (); +my @tosrules = (); my @tmpline = (); my @classline = (); my @subclassline = (); +my @tosruleline = (); my @l7ruleline = (); my @portruleline = (); my @proto = (); @@ -42,6 +45,7 @@ my $classfile = "/var/ipfire/qos/classes"; my $subclassfile = "/var/ipfire/qos/subclasses"; my $level7file = "/var/ipfire/qos/level7config"; my $portfile = "/var/ipfire/qos/portconfig"; +my $tosfile = "/var/ipfire/qos/tosconfig"; &General::readhash("${General::swroot}/ethernet/settings", \%netsettings); @@ -57,6 +61,7 @@ $qossettings{'ACK'} = ''; $qossettings{'MTU'} = '1492'; $qossettings{'RED_DEV'} = `cat /var/ipfire/red/iface`; $qossettings{'IMQ_DEV'} = 'imq0'; +$qossettings{'TOS'} = ''; $qossettings{'VALID'} = 'yes'; &General::readhash("${General::swroot}/qos/settings", \%qossettings); @@ -73,6 +78,9 @@ close FILE; open( FILE, "< $portfile" ) or die "Unable to read $portfile"; @portrules = ; close FILE; +open( FILE, "< $tosfile" ) or die "Unable to read $tosfile"; +@tosrules = ; +close FILE; ############################################################################################################################ ############################################################################################################################ @@ -116,6 +124,7 @@ case "\$1" in echo "[iptables]" iptables -t mangle -L QOS-OUT -v -x 2> /dev/null iptables -t mangle -L QOS-INC -v -x 2> /dev/null + iptables -t mangle -L QOS-TOS -v -x 2> /dev/null exit 0 ;; esac @@ -230,7 +239,9 @@ print </dev/null 2>&1 /usr/local/bin/qosd $qossettings{'IMQ_DEV'} >/dev/null 2>&1 @@ -572,11 +646,15 @@ print <> $classfile" ) or die "Unable to write $classfile"; print FILE <> $subclassfile" ) or die "Unable to write $subclassfile"; print FILE <= 100 && $qossettings{'CLASS'} < 121) { + $qossettings{'DEVICE'} = $qossettings{'RED_DEV'}; + } elsif ($qossettings{'CLASS'} >= 1000 && $qossettings{'CLASS'} < 1021) { + $qossettings{'DEVICE'} = $qossettings{'RED_DEV'}; + } elsif ($qossettings{'CLASS'} >= 200 && $qossettings{'CLASS'} < 221) { + $qossettings{'DEVICE'} = $qossettings{'IMQ_DEV'}; + } elsif ($qossettings{'CLASS'} >= 2000 && $qossettings{'CLASS'} < 2021) { + $qossettings{'DEVICE'} = $qossettings{'IMQ_DEV'}; + } + open( FILE, ">> $tosfile" ) or die "Unable to write $tosfile"; + print FILE <; + close FILE; + open( FILE, "> $tosfile" ) or die "Unable to read $tosfile"; + foreach $tosruleentry (sort @tosrules) + { + @tosruleline = split( /\;/, $tosruleentry ); + unless ( ($tosruleline[0] eq $qossettings{'CLASS'}) && ($tosruleline[2] eq $qossettings{'TOS'})) + { + print FILE $tosruleentry; + } + } + close FILE; + $message = "TOS-Regel ($qossettings{'CLASS'} - $qossettings{'TOS'}) wurde geloescht."; +} elsif ($qossettings{'DOTOS'} eq 'Bearbeiten') +{ + open( FILE, "< $tosfile" ) or die "Unable to read $tosfile"; + @tosrules = ; + close FILE; + open( FILE, "> $tosfile" ) or die "Unable to write $tosfile"; + foreach $tosruleentry (sort @tosrules) + { + @tosruleline = split( /\;/, $tosruleentry ); + if (( $tosruleline[0] eq $qossettings{'CLASS'} ) && ( $tosruleline[2] eq $qossettings{'TOS'} )) { + $qossettings{'DEVICE'} = $tosruleline[1]; + $qossettings{'CLASS'} = $tosruleline[0]; + $qossettings{'TOS'} = $tosruleline[2]; + $qossettings{'EDIT'} = 'yes'; + } else { + print FILE $tosruleentry; + } + } + close FILE; + &tosrule(); + &Header::closebigbox(); + &Header::closepage(); + exit +} + +############################################################################################################################ +############################################################################################################################ + if ($qossettings{'ACTION'} eq 'Start') { system("/usr/local/bin/qosctrl generate >/dev/null 2>&1"); @@ -374,25 +444,39 @@ elsif ($qossettings{'ACTION'} eq 'Statusinformationen') } elsif ($qossettings{'ACTION'} eq 'Grafische Auswertung') { - &Header::openbox('100%', 'left', 'QoS Graphen'); - print <Diese Seite braucht je nach Geschwindigkeit des Computers laenger zum Laden. - -END -; - &Header::closebox(); open( FILE, "< $classfile" ) or die "Unable to read $classfile"; @classes = ; close FILE; open( FILE, "< $subclassfile" ) or die "Unable to read $subclassfile"; @subclasses = ; close FILE; + &Header::openbox('100%', 'left', 'QoS Graphen'); + print < Diese Seite braucht je nach Geschwindigkeit des Computers laenger zum Laden. + Klasse: +END +; + foreach $classentry (sort @classes) + { + @classline = split( /\;/, $classentry ); + $qossettings{'CLASS'}=$classline[1]; + print < +END +; + } + print < +END +; + &Header::closebox(); foreach $classentry (sort @classes) { @classline = split( /\;/, $classentry ); $qossettings{'DEV'}=$classline[0]; $qossettings{'CLASS'}=$classline[1]; &gengraph($qossettings{'DEV'},$qossettings{'CLASS'}); + print "\n"; } print < @@ -442,16 +527,41 @@ elsif ($qossettings{'ACTION'} eq 'Unterklasse hinzufuegen') &Header::closepage(); exit } -elsif ($qossettings{'ACTION'} eq 'Level7-Regel hinzufuegen') +elsif ($qossettings{'ACTION'} eq 'Regel hinzufuegen') { - &level7rule(); - &Header::closebigbox(); - &Header::closepage(); - exit -} -elsif ($qossettings{'ACTION'} eq 'Port-Regel hinzufuegen') -{ - &portrule(); + &Header::openbox('100%', 'center', 'Regel hinzufuegen'); + print < + Waehlen sie eine der untenstehenden Regeln aus. + + + + + +END +; + &Header::closebox(); + print <