]>
git.ipfire.org Git - ipfire-2.x.git/blob - html/cgi-bin/qos.cgi
5 # This code is distributed under the terms of the GPL
12 # enable only the following on debugging purpose
14 #use CGI::Carp 'fatalsToBrowser';
16 require '/var/ipfire/general-functions.pl';
17 require "${General::swroot}/lang.pl";
18 require "${General::swroot}/header.pl";
19 require "${General::swroot}/graphs.pl";
25 my $errormessage = "";
29 my $subclassentry = "";
31 my $portruleentry = "";
32 my $tosruleentry = "";
41 my @subclassline = ();
43 my @portruleline = ();
48 my $classfile = "/var/ipfire/qos/classes";
49 my $subclassfile = "/var/ipfire/qos/subclasses";
50 my $level7file = "/var/ipfire/qos/level7config";
51 my $portfile = "/var/ipfire/qos/portconfig";
52 my $tosfile = "/var/ipfire/qos/tosconfig";
53 &General
::readhash
("${General::swroot}/ethernet/settings", \
%netsettings);
55 &Header
::showhttpheaders
();
57 $qossettings{'ENABLED'} = 'off';
58 $qossettings{'EDIT'} = 'no';
59 $qossettings{'OUT_SPD'} = '';
60 $qossettings{'INC_SPD'} = '';
61 $qossettings{'DEF_OUT_SPD'} = '';
62 $qossettings{'DEF_INC_SPD'} = '';
63 $qossettings{'DEFCLASS_INC'} = '';
64 $qossettings{'DEFCLASS_OUT'} = '';
65 $qossettings{'ACK'} = '';
66 $qossettings{'MTU'} = '1492';
67 $qossettings{'SFQ_PERTUB'} = '10';
68 $qossettings{'QLENGTH'} = '30';
69 $qossettings{'RED_DEV'} = `cat /var/ipfire/red/iface`;
70 $qossettings{'IMQ_DEV'} = 'imq0';
71 $qossettings{'VALID'} = 'yes';
72 ### Values that have to be initialized
73 $qossettings{'ACTION'} = '';
74 $qossettings{'ACTIONDEF'} = '';
75 $qossettings{'ACTIONBW'} = '';
76 $qossettings{'RED_DEV_SEL'} = '';
77 $qossettings{'IMQ_DEV_SEL'} = '';
78 $qossettings{'PRIO'} = '';
79 $qossettings{'SPD'} = '';
80 $qossettings{'CLASS'} = '';
81 $qossettings{'SCLASS'} = '';
82 $qossettings{'QPORT'} = '';
83 $qossettings{'DPORT'} = '';
84 $qossettings{'QIP'} = '';
85 $qossettings{'DIP'} = '';
86 $qossettings{'PPROT'} = '';
87 $qossettings{'L7PROT'} = '';
88 $qossettings{'DEVICE'} = '';
89 $qossettings{'MINBWDTH'} = '';
90 $qossettings{'MAXBWDTH'} = '';
91 $qossettings{'BURST'} = '';
92 $qossettings{'CBURST'} = '';
93 $qossettings{'DOCLASS'} = '';
94 $qossettings{'DOSCLASS'} = '';
95 $qossettings{'DOLEVEL7'} = '';
96 $qossettings{'DOPORT'} = '';
97 $qossettings{'CLASS'} = '';
98 $qossettings{'CLASSPRFX'} = '';
99 $qossettings{'DEV'} = '';
100 $qossettings{'TOS'} = '';
103 &General
::readhash
("${General::swroot}/qos/settings", \
%qossettings);
104 &Header
::getcgihash
(\
%qossettings);
107 my %mainsettings = ();
108 &General
::readhash
("${General::swroot}/main/settings", \
%mainsettings);
109 &General
::readhash
("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \
%color);
111 &Header
::openpage
('QoS', 1, '');
112 &Header
::openbigbox
('100%', 'left', '', $errormessage);
114 ############################################################################################################################
115 ############################################################################################################################
117 if ($qossettings{'DOCLASS'} eq $Lang::tr
{'save'})
122 if ( $qossettings{'VALID'} eq 'yes' ) {
123 open( FILE
, ">> $classfile" ) or die "Unable to write $classfile";
125 $qossettings{'DEVICE'};$qossettings{'CLASS'};$qossettings{'PRIO'};$qossettings{'MINBWDTH'};$qossettings{'MAXBWDTH'};$qossettings{'BURST'};$qossettings{'CBURST'};$qossettings{'TOS'};$qossettings{'REMARK'};
130 $qossettings{'ACTION'} = 'Parentklasse hinzufuegen';
133 elsif ($qossettings{'DOCLASS'} eq 'Bearbeiten')
135 open( FILE
, "< $classfile" ) or die "Unable to read $classfile";
138 open( FILE
, "> $classfile" ) or die "Unable to write $classfile";
139 foreach $classentry (sort @classes)
141 @classline = split( /\;/, $classentry );
142 if ( $classline[1] ne $qossettings{'CLASS'} ) {
143 print FILE
$classentry;
145 $qossettings{'DEVICE'} = $classline[0];
146 $qossettings{'PRIO'} = $classline[2];
147 $qossettings{'MINBWDTH'} = $classline[3];
148 $qossettings{'MAXBWDTH'} = $classline[4];
149 $qossettings{'BURST'} = $classline[5];
150 $qossettings{'CBURST'} = $classline[6];
151 $qossettings{'TOS'} = $classline[7];
152 $qossettings{'REMARK'} = $classline[8];
153 $qossettings{'EDIT'} = 'yes';
158 &Header
::closebigbox
();
159 &Header
::closepage
();
162 elsif ($qossettings{'DOCLASS'} eq 'Loeschen')
164 open( FILE
, "< $classfile" ) or die "Unable to read $classfile";
167 open( FILE
, "> $classfile" ) or die "Unable to write $classfile";
168 foreach $classentry (sort @tmp)
170 @tmpline = split( /\;/, $classentry );
171 if ( $tmpline[1] ne $qossettings{'CLASS'} )
173 print FILE
$classentry;
177 open( FILE
, "< $subclassfile" ) or die "Unable to read $classfile";
180 open( FILE
, "> $subclassfile" ) or die "Unable to write $classfile";
181 foreach $subclassentry (sort @tmp)
183 @tmpline = split( /\;/, $subclassentry );
184 if ( $tmpline[1] ne $qossettings{'CLASS'} )
186 print FILE
$subclassentry;
190 $message = "$Lang::tr{'Class'} $qossettings{'CLASS'} $Lang::tr{'Class was deleted'}";
193 ############################################################################################################################
194 ############################################################################################################################
196 if ($qossettings{'DOSCLASS'} eq $Lang::tr
{'save'})
200 if ( $qossettings{'VALID'} eq 'yes' ) {
201 open( FILE
, ">> $subclassfile" ) or die "Unable to write $subclassfile";
203 $qossettings{'DEVICE'};$qossettings{'CLASS'};$qossettings{'SCLASS'};$qossettings{'PRIO'};$qossettings{'MINBWDTH'};$qossettings{'MAXBWDTH'};$qossettings{'BURST'};$qossettings{'CBURST'};$qossettings{'TOS'};
208 $qossettings{'ACTION'} = 'Unterklasse hinzufuegen';
210 } elsif ($qossettings{'DOSCLASS'} eq 'Loeschen')
212 open( FILE
, "< $subclassfile" ) or die "Unable to read $classfile";
215 open( FILE
, "> $subclassfile" ) or die "Unable to write $classfile";
216 foreach $subclassentry (sort @tmp)
218 @tmpline = split( /\;/, $subclassentry );
219 if ( $tmpline[2] ne $qossettings{'CLASS'} )
221 print FILE
$subclassentry;
225 $message = "$Lang::tr{'Subclass'} $qossettings{'CLASS'} $Lang::tr{'was deleted'}.";
228 ############################################################################################################################
229 ############################################################################################################################
231 if ($qossettings{'DOLEVEL7'} eq $Lang::tr
{'save'})
233 if ( $qossettings{'QIP'} ne '' ) {
234 unless ( &General
::validip
($qossettings{'QIP'}) ) {
235 $qossettings{'VALID'} = 'no';
236 $message = "Die Quell-IP-Adresse ist ungueltig.";
239 if ( $qossettings{'DIP'} ne '' ) {
240 unless ( &General
::validip
($qossettings{'DIP'}) ) {
241 $qossettings{'VALID'} = 'no';
242 $message = "Die Ziel-IP-Adresse ist ungueltig.";
245 if ($qossettings{'CLASS'} >= 100 && $qossettings{'CLASS'} < 121) {
246 $qossettings{'DEVICE'} = $qossettings{'RED_DEV'};
247 } elsif ($qossettings{'CLASS'} >= 1000 && $qossettings{'CLASS'} < 1021) {
248 $qossettings{'DEVICE'} = $qossettings{'RED_DEV'};
249 } elsif ($qossettings{'CLASS'} >= 200 && $qossettings{'CLASS'} < 221) {
250 $qossettings{'DEVICE'} = $qossettings{'IMQ_DEV'};
251 } elsif ($qossettings{'CLASS'} >= 2000 && $qossettings{'CLASS'} < 2021) {
252 $qossettings{'DEVICE'} = $qossettings{'IMQ_DEV'};
254 if ( $qossettings{'VALID'} eq 'yes' ) {
255 open( FILE
, ">> $level7file" ) or die "Unable to write $level7file";
257 $qossettings{'CLASS'};$qossettings{'DEVICE'};$qossettings{'L7PROT'};$qossettings{'QIP'};$qossettings{'DIP'};
262 $qossettings{'ACTION'} = 'Level7-Regel hinzufuegen';
264 } elsif ($qossettings{'DOLEVEL7'} eq 'Loeschen')
266 open( FILE
, "< $level7file" ) or die "Unable to read $level7file";
269 system("rm $level7file");
270 foreach $l7ruleentry (sort @l7rules)
272 @l7ruleline = split( /\;/, $l7ruleentry );
273 if ( ($l7ruleline[0] eq $qossettings{'CLASS'}) && ($l7ruleline[2] eq $qossettings{'L7PROT'}))
274 {$message = "Level7-Regel ($qossettings{'CLASS'} - $qossettings{'L7PROT'}) wurde geloescht.";}
276 { open( FILE
, ">> $level7file" ) or die "Unable to read $level7file";
277 print FILE
$l7ruleentry;
281 open( FILE
, "< $level7file" ) or system("touch $level7file");close FILE
;
282 } elsif ($qossettings{'DOLEVEL7'} eq 'Bearbeiten')
284 open( FILE
, "< $level7file" ) or die "Unable to read $level7file";
287 system("rm $level7file");
288 foreach $l7ruleentry (sort @l7rules)
290 @l7ruleline = split( /\;/, $l7ruleentry );
291 if ( ($l7ruleline[0] eq $qossettings{'CLASS'}) && ($l7ruleline[2] eq $qossettings{'L7PROT'}))
292 {$qossettings{'QIP'} = $l7ruleline[3];$qossettings{'DIP'} = $l7ruleline[4];}
294 open( FILE
, ">> $level7file" ) or die "Unable to write $level7file";
295 print FILE
$l7ruleentry;
300 open( FILE
, "< $level7file" ) or system("touch $level7file");close FILE
;
303 ############################################################################################################################
304 ############################################################################################################################
306 if ($qossettings{'DOPORT'} eq $Lang::tr
{'save'})
308 if ( $qossettings{'QIP'} ne '' ) {
309 unless ( &General
::validip
($qossettings{'QIP'}) ) {
310 $qossettings{'VALID'} = 'no';
311 $message = "Die Quell-IP-Adresse ist ungueltig.";
314 if ( $qossettings{'DIP'} ne '' ) {
315 unless ( &General
::validip
($qossettings{'DIP'}) ) {
316 $qossettings{'VALID'} = 'no';
317 $message = "Die Ziel-IP-Adresse ist ungueltig.";
320 if ($qossettings{'CLASS'} >= 100 && $qossettings{'CLASS'} < 121) {
321 $qossettings{'DEVICE'} = $qossettings{'RED_DEV'};
322 } elsif ($qossettings{'CLASS'} >= 1000 && $qossettings{'CLASS'} < 1021) {
323 $qossettings{'DEVICE'} = $qossettings{'RED_DEV'};
324 } elsif ($qossettings{'CLASS'} >= 200 && $qossettings{'CLASS'} < 221) {
325 $qossettings{'DEVICE'} = $qossettings{'IMQ_DEV'};
326 } elsif ($qossettings{'CLASS'} >= 2000 && $qossettings{'CLASS'} < 2021) {
327 $qossettings{'DEVICE'} = $qossettings{'IMQ_DEV'};
329 if ( $qossettings{'VALID'} eq 'yes' ) {
330 open( FILE
, ">> $portfile" ) or die "Unable to write $portfile";
332 $qossettings{'CLASS'};$qossettings{'DEVICE'};$qossettings{'PPROT'};$qossettings{'QIP'};$qossettings{'QPORT'};$qossettings{'DIP'};$qossettings{'DPORT'};
337 $qossettings{'ACTION'} = 'Port-Regel hinzufuegen';
339 } elsif ($qossettings{'DOPORT'} eq 'Loeschen')
341 open( FILE
, "< $portfile" ) or die "Unable to read $portfile";
344 open( FILE
, "> $portfile" ) or die "Unable to read $portfile";
345 foreach $portruleentry (sort @portrules)
347 @portruleline = split( /\;/, $portruleentry );
348 unless ( ($portruleline[0] eq $qossettings{'CLASS'}) && ($portruleline[2] eq $qossettings{'PPROT'}) && ($portruleline[3] eq $qossettings{'QIP'}) && ($portruleline[4] eq $qossettings{'QPORT'}) && ($portruleline[5] eq $qossettings{'DIP'}) && ($portruleline[6] eq $qossettings{'DPORT'}))
350 print FILE
$portruleentry;
354 $message = "$Lang::tr{'Port Rule'} ($qossettings{'CLASS'} - $qossettings{'PPROT'}) $Lang::tr{'was deleted'}.";
355 } elsif ($qossettings{'DOPORT'} eq 'Bearbeiten')
357 open( FILE
, "< $portfile" ) or die "Unable to read $portfile";
360 system("rm $portfile");
361 foreach $portruleentry (sort @portrules)
363 @portruleline = split( /\;/, $portruleentry );
364 if ( ($portruleline[0] eq $qossettings{'CLASS'}) && ($portruleline[2] eq $qossettings{'PPROT'}) && ($portruleline[3] eq $qossettings{'QIP'}) && ($portruleline[4] eq $qossettings{'QPORT'}) && ($portruleline[5] eq $qossettings{'DIP'}) && ($portruleline[6] eq $qossettings{'DPORT'}))
365 {$qossettings{'CLASS'}=$portruleline[0];$qossettings{'PPROT'}=$portruleline[2];$qossettings{'QIP'}=$portruleline[3];$qossettings{'QPORT'}=$portruleline[4];$qossettings{'DIP'}=$portruleline[5];$qossettings{'DPORT'}=$portruleline[6];}
367 open( FILE
, ">> $portfile" ) or die "Unable to write $portfile";
368 print FILE
$portruleentry;
373 open( FILE
, "< $portfile" ) or system("touch $portfile");close FILE
;
376 ############################################################################################################################
377 ############################################################################################################################
379 if ($qossettings{'DOTOS'} eq $Lang::tr
{'save'})
381 if ($qossettings{'CLASS'} >= 100 && $qossettings{'CLASS'} < 121) {
382 $qossettings{'DEVICE'} = $qossettings{'RED_DEV'};
383 } elsif ($qossettings{'CLASS'} >= 1000 && $qossettings{'CLASS'} < 1021) {
384 $qossettings{'DEVICE'} = $qossettings{'RED_DEV'};
385 } elsif ($qossettings{'CLASS'} >= 200 && $qossettings{'CLASS'} < 221) {
386 $qossettings{'DEVICE'} = $qossettings{'IMQ_DEV'};
387 } elsif ($qossettings{'CLASS'} >= 2000 && $qossettings{'CLASS'} < 2021) {
388 $qossettings{'DEVICE'} = $qossettings{'IMQ_DEV'};
390 open( FILE
, ">> $tosfile" ) or die "Unable to write $tosfile";
392 $qossettings{'CLASS'};$qossettings{'DEVICE'};$qossettings{'TOS'};
397 elsif ($qossettings{'DOTOS'} eq 'Loeschen')
399 open( FILE
, "< $tosfile" ) or die "Unable to read $tosfile";
402 open( FILE
, "> $tosfile" ) or die "Unable to read $tosfile";
403 foreach $tosruleentry (sort @tosrules)
405 @tosruleline = split( /\;/, $tosruleentry );
406 unless ( ($tosruleline[0] eq $qossettings{'CLASS'}) && ($tosruleline[2] eq $qossettings{'TOS'}))
408 print FILE
$tosruleentry;
412 $message = "$Lang::tr{'TOS Rule'} ($qossettings{'CLASS'} - $qossettings{'TOS'}) $Lang::tr{'was deleted'}.";
413 } elsif ($qossettings{'DOTOS'} eq 'Bearbeiten')
415 open( FILE
, "< $tosfile" ) or die "Unable to read $tosfile";
418 open( FILE
, "> $tosfile" ) or die "Unable to write $tosfile";
419 foreach $tosruleentry (sort @tosrules)
421 @tosruleline = split( /\;/, $tosruleentry );
422 if (( $tosruleline[0] eq $qossettings{'CLASS'} ) && ( $tosruleline[2] eq $qossettings{'TOS'} )) {
423 $qossettings{'DEVICE'} = $tosruleline[1];
424 $qossettings{'CLASS'} = $tosruleline[0];
425 $qossettings{'TOS'} = $tosruleline[2];
426 $qossettings{'EDIT'} = 'yes';
428 print FILE
$tosruleentry;
433 &Header
::closebigbox
();
434 &Header
::closepage
();
438 ############################################################################################################################
439 ############################################################################################################################
441 if ($qossettings{'ACTION'} eq 'Start')
443 system("/usr/local/bin/qosctrl generate >/dev/null 2>&1");
444 system("/usr/bin/touch /var/ipfire/qos/enable");
445 system("/usr/local/bin/qosctrl start >/dev/null 2>&1");
446 system("logger -t ipfire 'QoS started'");
447 $qossettings{'ENABLED'} = 'on';
448 &General
::writehash
("${General::swroot}/qos/settings", \
%qossettings);
450 elsif ($qossettings{'ACTION'} eq 'Stop')
452 system("/usr/local/bin/qosctrl stop >/dev/null 2>&1");
453 unlink "/var/ipfire/qos/bin/qos.sh";
454 unlink "/var/ipfire/qos/enable";
455 system("logger -t ipfire 'QoS stopped'");
456 $qossettings{'ENABLED'} = 'off';
457 &General
::writehash
("${General::swroot}/qos/settings", \
%qossettings);
459 elsif ($qossettings{'ACTION'} eq 'Neustart')
461 if ($qossettings{'ENABLED'} eq 'on'){
462 system("/usr/local/bin/qosctrl stop >/dev/null 2>&1");
463 system("/usr/local/bin/qosctrl generate >/dev/null 2>&1");
464 system("/usr/local/bin/qosctrl start >/dev/null 2>&1");
465 system("logger -t ipfire 'QoS restarted'");
468 elsif ($qossettings{'ACTION'} eq $Lang::tr
{'save'})
470 if ($qossettings{'DEF_INC_SPD'} eq '') {
471 $qossettings{'DEF_INC_SPD'} = int($qossettings{'INC_SPD'} * 0.9);
473 if ($qossettings{'DEF_OUT_SPD'} eq '') {
474 $qossettings{'DEF_OUT_SPD'} = int($qossettings{'OUT_SPD'} * 0.9);
476 &General
::writehash
("${General::swroot}/qos/settings", \
%qossettings);
478 elsif ($qossettings{'ACTION'} eq 'Statusinformationen')
480 &Header
::openbox
('100%', 'left', 'QoS Status');
481 if ($qossettings{'ENABLED'} eq 'on'){
483 $output = `/usr/local/bin/qosctrl status`;
484 $output = &Header
::cleanhtml
($output,"y");
485 print "<pre>$output</pre>\n";
486 } else { print "$Lang::tr{'QoS not enabled'}"; }
488 &Header
::closebigbox
();
489 &Header
::closepage
();
492 elsif ($qossettings{'ACTION'} eq 'Parentklasse hinzufuegen')
495 &Header
::closebigbox
();
496 &Header
::closepage
();
499 elsif ($qossettings{'ACTION'} eq 'Unterklasse hinzufuegen')
502 &Header
::closebigbox
();
503 &Header
::closepage
();
506 elsif ($qossettings{'ACTION'} eq 'Regel hinzufuegen')
508 &Header
::openbox
('100%', 'center', $Lang::tr
{'Add Rule'});
511 <tr><td align='center'>$Lang::tr{'Choose Rule'}
512 <tr><td align='center'>
513 <input type="button" onClick="swapVisibility('l7rule')" value='Level7-Regel' />
514 <input type="button" onClick="swapVisibility('portrule')" value='Port-Regel' />
515 <input type="button" onClick="swapVisibility('tosrule')" value='TOS-Regel' />
521 <div id='l7rule' style='display: none'>
527 <div id='portrule' style='display: none'>
533 <div id='tosrule' style='display: none'>
541 &Header
::closebigbox
();
542 &Header
::closepage
();
545 elsif ($qossettings{'ACTION'} eq 'Erweiterte Einstellungen')
548 &Header
::closebigbox
();
549 &Header
::closepage
();
552 if ($qossettings{'ACTIONBW'} eq 'Andern')
555 &Header
::closebigbox
();
556 &Header
::closepage
();
559 if ($qossettings{'ACTIONDEF'} eq 'Andern')
562 &Header
::closebigbox
();
563 &Header
::closepage
();
567 &General
::readhash
("${General::swroot}/qos/settings", \
%qossettings);
569 my $status = $Lang::tr
{'stopped'};
570 my $statuscolor = '#993333';
571 if ( $qossettings{'ENABLED'} eq 'on' ) {
572 $status = $Lang::tr
{'running'};
573 $statuscolor = '#339933';
576 if ( $netsettings{'RED_TYPE'} ne 'PPPOE' ) {
577 $qossettings{'RED_DEV'} = $netsettings{'RED_DEV'};
581 &Header
::openbox
('100%', 'left', $Lang::tr
{'error messages'});
582 print "<class name='base'>$errormessage\n";
583 print " </class>\n";
587 ############################################################################################################################
588 ############################################################################################################################
590 &Header
::openbox
('100%', 'center', 'Quality of Service');
593 <form method='post' action='$ENV{'SCRIPT_NAME'}'>
597 if ( $message ne "" ) {
598 print "<tr><td colspan='2' align='center'><font color='red'>$message</font>";
601 <tr><td width='50%' align='left'><b>Quality of Service:</b>
602 <td width='50%' align='center' bgcolor='$statuscolor'><font color='white'>$status</font>
603 <tr><td width='100%' align='center' colspan='2'>
604 <input type='submit' name='ACTION' value="Start" />
605 <input type='submit' name='ACTION' value="Stop" />
606 <input type='submit' name='ACTION' value="$Lang::tr{'restart'}" /></table></form>
609 if (($qossettings{'OUT_SPD'} ne '') && ($qossettings{'INC_SPD'} ne '')) {
611 <form method='post' action='$ENV{'SCRIPT_NAME'}'>
613 <tr><td colspan='3'>
614 <tr><td width='50%' align='right'>$Lang::tr{'downlink speed'}: <td width='30%' align='left'>$qossettings{'INC_SPD'}
615 <td width='20%' rowspan='2' align='center' valign='middle'><input type='submit' name='ACTIONBW' value='Andern' />
616 <tr><td width='50%' align='right'>$Lang::tr{'uplink speed'}: <td width='30%' align='left'>$qossettings{'OUT_SPD'}
621 if (($qossettings{'DEFCLASS_OUT'} ne '') && ($qossettings{'DEFCLASS_INC'} ne '')&& ($qossettings{'ACK'} ne '')) {
623 <form method='post' action='$ENV{'SCRIPT_NAME'}'>
625 <tr><td colspan='3'><hr />
626 <tr><td width='50%' align='right'>$Lang::tr{'downlink std class'}: <td width='30%' align='left'>$qossettings{'DEFCLASS_INC'}
627 <td width='20%' rowspan='3' align='center' valign='middle'><input type='submit' name='ACTIONDEF' value='Andern' />
628 <tr><td width='50%' align='right'>$Lang::tr{'uplink std class'}: <td width='30%' align='left'>$qossettings{'DEFCLASS_OUT'}
629 <tr><td width='50%' align='right'>ACKs: <td width='30%' align='left'>$qossettings{'ACK'}
630 <tr><td colspan='3' width='100%'><hr />
631 <tr><td colspan='3' width='100%' align='center'>
634 <form method='post' action='$ENV{'SCRIPT_NAME'}'>
635 <table border='0' cellpadding='0' cellspacing='0'>
636 <tr><td><input type='submit' name='ACTION' value='Parentklasse hinzufuegen' />
637 <td><input type='submit' name='ACTION' value='Erweiterte Einstellungen' />
638 <td><input type='submit' name='ACTION' value='Statusinformationen' />
646 if ( ($qossettings{'OUT_SPD'} eq '') || ($qossettings{'INC_SPD'} eq '') ) {
648 &Header
::closebigbox
();
649 &Header
::closepage
();
653 if ( ($qossettings{'DEFCLASS_INC'} eq '') || ($qossettings{'DEFCLASS_OUT'} eq '') || ($qossettings{'ACK'} eq '') ) {
655 &Header
::closebigbox
();
656 &Header
::closepage
();
660 &Header
::openbox
('100%', 'center', $Lang::tr
{'info'});
661 &Graphs
::overviewgraph
("3240",$qossettings{'RED_DEV'});
662 &Graphs
::overviewgraph
("3240",$qossettings{'IMQ_DEV'});
665 <tr><td colspan='9' align='center' valign='middle'><img alt="" src='/images/addblue.gif' /> $Lang::tr{'add subclass'} | <img alt="" src='/images/addgreen.gif' /> $Lang::tr{'Add Rule'} | <img alt="" src='/images/edit.gif' /> $Lang::tr{'edit'} | <img alt="" src='/images/delete.gif' /> $Lang::tr{'delete'}
666 <tr><td colspan='9' align='right' valign='middle'><b>$Lang::tr{'TOS Bits'}:</b> <b>0</b> - $Lang::tr{'disabled'} | <b>8</b> - $Lang::tr{'min delay'} | <b>4</b> - $Lang::tr{'max throughput'} | <b>2</b> - $Lang::tr{'max reliability'} | <b>1</b> - $Lang::tr{'min costs'}
669 if (( -e
"/srv/web/ipfire/html/graphs/qos-graph-$qossettings{'RED_DEV'}-3240.png") && ( -e
"/srv/web/ipfire/html/graphs/qos-graph-$qossettings{'IMQ_DEV'}-3240.png")) {
671 <tr><td colspan='9' align='center'><a href='/cgi-bin/qosgraph.cgi?graph=$qossettings{'RED_DEV'}'><img alt="" src="/graphs/qos-graph-$qossettings{'RED_DEV'}-3240.png" border='0' /></a></td></tr>
672 <tr><td colspan='9' align='center'><a href='/cgi-bin/qosgraph.cgi?graph=$qossettings{'IMQ_DEV'}'><img alt="" src="/graphs/qos-graph-$qossettings{'IMQ_DEV'}-3240.png" border='0' /></a></td></tr>
677 print $Lang::tr
{'no information available'};
683 &showclasses
($qossettings{'RED_DEV'});
684 &showclasses
($qossettings{'IMQ_DEV'});
686 &Header
::closebigbox
();
687 &Header
::closepage
();
689 ############################################################################################################################
690 ############################################################################################################################
692 sub changedefclasses
{
693 &Header
::openbox
('100%', 'center', $Lang::tr
{'std classes'});
695 <form method='post' action='$ENV{'SCRIPT_NAME'}'>
697 <tr><td width='100%' colspan='3'>$Lang::tr{'no filter pass'}
698 <tr><td width='33%' align='right'>Download:<td width='33%' align='left'><select name='DEFCLASS_INC'>
701 for ( $c = 200 ; $c <= 220 ; $c++ )
703 if ( $qossettings{'DEFCLASS_INC'} ne $c )
704 { print "<option value='$c'>$c</option>\n"; }
705 else { print "<option selected value='$c'>$c</option>\n"; }
708 </select><td width='33%' align='center'>
709 <tr><td width='33%' align='right'>Upload:<td width='33%' align='left'><select name='DEFCLASS_OUT'>
712 for ( $c = 100 ; $c <= 120 ; $c++ )
714 if ( $qossettings{'DEFCLASS_OUT'} ne $c )
715 { print "<option value='$c'>$c</option>\n"; }
716 else { print "<option selected value='$c'>$c</option>\n"; }
719 </select><td width='33%' align='center'>
723 <tr><td width='100%' colspan='3'>$Lang::tr{'enter ack class'}
724 <tr><td width='33%' align='right'>ACKs:<td width='33%' align='left'><select name='ACK'>
727 for ( $c = 100 ; $c <= 120 ; $c++ )
729 if ( $qossettings{'ACK'} ne $c )
730 { print "<option value='$c'>$c</option>\n"; }
731 else { print "<option selected value='$c'>$c</option>\n"; }
734 </select><td width='33%' align='center'><input type='submit' name='ACTION' value="$Lang::tr{'save'}" />
742 sub changebandwidth
{
743 &Header
::openbox
('100%', 'center', $Lang::tr
{'bandwithsettings'});
744 if ($qossettings{'ENABLED'} eq 'on') {
745 print "$Lang::tr{'bandwitherror'}";
746 print "<a href='/cgi-bin/qos.cgi'>$Lang::tr{'back'}</a>";
749 <form method='post' action='$ENV{'SCRIPT_NAME'}'>
750 <input type='hidden' name='DEF_OUT_SPD' value='' /><input type='hidden' name='DEF_INC_SPD' value='' />
752 <tr><td width='100%' colspan='3'>$Lang::tr{'down and up speed'}
753 <tr><td width='50%' align='right'>$Lang::tr{'downlink speed'}:
754 <td width='30%' align='left'><input type='text' name='INC_SPD' maxlength='8' value="$qossettings{'INC_SPD'}" />
755 <td width='20%' align='center'>
756 <tr><td width='50%' align='right'>$Lang::tr{'uplink speed'}:
757 <td width='30%' align='left'><input type='text' name='OUT_SPD' maxlength='8' value="$qossettings{'OUT_SPD'}" />
758 <td width='20%' align='center'><input type='submit' name='ACTION' value="$Lang::tr{'save'}" /> <input type='reset' name='ACTION' value="$Lang::tr{'reset'}" />
768 &Header
::openbox
('100%', 'center', $Lang::tr
{'parentclass'});
770 <form method='post' action='$ENV{'SCRIPT_NAME'}'>
774 if ( $message ne "" ) {
775 print "<tr><td colspan='3' align='center'>$message";
777 if ( $qossettings{'EDIT'} eq 'yes' ) {
778 print "<input type='hidden' name='CLASS' value='$qossettings{'CLASS'}' />";
779 print "<input type='hidden' name='DEVICE' value='$qossettings{'DEVICE'}' />";
782 <tr><td width='100%' colspan='3'>$Lang::tr{'enter data'}
783 <tr><td width='33%' align='right'>$Lang::tr{'interface'}:
784 <td width='33%' align='left'>
787 if ( $qossettings{'EDIT'} eq 'yes' ) {
788 print "<select name='DEVICE' disabled>";
790 print "<select name='DEVICE'>";
792 if ( $qossettings{'DEVICE'} eq $qossettings{'RED_DEV'} ) {
793 $qossettings{'RED_DEV_SEL'} = 'selected';
794 } elsif ( $qossettings{'DEVICE'} eq $qossettings{'IMQ_DEV'} ) {
795 $qossettings{'IMQ_DEV_SEL'} = 'selected';
798 <option value='$qossettings{'RED_DEV'}' $qossettings{'RED_DEV_SEL'}>$qossettings{'RED_DEV'}</option>
799 <option value='$qossettings{'IMQ_DEV'}' $qossettings{'IMQ_DEV_SEL'}>$qossettings{'IMQ_DEV'}</option></select>
800 <td width='33%' align='center'>
801 <tr><td width='33%' align='right'>$Lang::tr{'Class'}:<td width='33%' align='left'>
804 if ( $qossettings{'EDIT'} eq 'yes' ) {
805 print "<select name='CLASS' disabled>";
807 print "<select name='CLASS'>";
809 for ( $c = 100 ; $c <= 120 ; $c++ )
811 if ( $qossettings{'CLASS'} ne $c )
812 { print "<option value='$c'>$c</option>\n"; }
813 else { print "<option selected value='$c'>$c</option>\n"; }
815 for ( $c = 200 ; $c <= 220 ; $c++ )
817 if ( $qossettings{'CLASS'} ne $c )
818 { print "<option value='$c'>$c</option>\n"; }
819 else { print "<option selected value='$c'>$c</option>\n"; }
823 <td width='33%' align='center'>
824 <tr><td width='33%' align='right'>$Lang::tr{'priority'}:<td width='33%' align='left'><select name='PRIO'>
827 for ( $c = 1 ; $c <= 7 ; $c++ )
829 if ( $qossettings{'PRIO'} ne $c )
830 { print "<option value='$c'>$c</option>\n"; }
831 else { print "<option selected value='$c'>$c</option>\n"; }
833 if ($qossettings{'MINBWDTH'} eq "") { $qossettings{'MINBWDTH'} = "1"; }
836 <td width='33%' align='center'>
837 <tr><td width='33%' align='right'>$Lang::tr{'guaranteed bandwith'}:
838 <td width='33%' align='left'><input type='text' size='20' name='MINBWDTH' maxlength='8' required='1' value="$qossettings{'MINBWDTH'}" />
839 <td width='33%' align='center'>
840 <tr><td width='33%' align='right'>$Lang::tr{'max bandwith'}:
841 <td width='33%' align='left'><input type='text' size='20' name='MAXBWDTH' maxlength='8' required='1' value="$qossettings{'MAXBWDTH'}" />
842 <td width='33%' align='center'>
843 <tr><td width='33%' align='right'>Burst:
844 <td width='33%' align='left'><input type='text' size='20' name='BURST' maxlength='8' value="$qossettings{'BURST'}" />
845 <td width='33%' align='center'>
846 <tr><td width='33%' align='right'>Ceilburst:
847 <td width='33%' align='left'><input type='text' size='20' name='CBURST' maxlength='8' value="$qossettings{'CBURST'}" />
848 <td width='33%' align='center'>
849 <tr><td width='33%' align='right'>TOS-Bit:
850 <td width='33%' align='left'><select name='TOS'>
851 <option value='0'>$Lang::tr{'disabled'} (0)</option>
852 <option value='8'>$Lang::tr{'min delay'} (8)</option>
853 <option value='4'>$Lang::tr{'max throughput'} (4)</option>
854 <option value='2'>$Lang::tr{'max reliability'} (2)</option>
855 <option value='1'>$Lang::tr{'min costs'} (1)</option></select>
856 <td width='33%' align='center'>
857 <tr><td width='33%' align='right'>$Lang::tr{'remark'}:
858 <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' />
859 <tr><td width='33%' align='right'>
860 <td width='33%' align='left'>
861 <td width='33%' align='center'><input type='submit' name='DOCLASS' value='$Lang::tr{'save'}' /> <input type='reset' value='$Lang::tr{'reset'}' />
869 &Header
::openbox
('100%', 'center', $Lang::tr
{'Subclass'});
871 <form method='post' action='$ENV{'SCRIPT_NAME'}'>
875 if ( $message ne "" ) {
876 print "<tr><td colspan='3' align='center'>$message";
879 <tr><td colspan='3' width='100%'>$Lang::tr{'current class'}: $qossettings{'CLASS'}
880 <tr><td width='100%' colspan='3'>$Lang::tr{'enter data'}
881 <tr><td width='33%' align='right'>$Lang::tr{'Subclass'}:<td width='33%' align='left'><select name='SCLASS'>
884 if ($qossettings{'CLASS'} >= 100 && $qossettings{'CLASS'} < 121) {
885 $qossettings{'DEVICE'} = $qossettings{'RED_DEV'};
886 for ( $c = 1000 ; $c <= 1020 ; $c++ )
888 if ( $qossettings{'SCLASS'} ne $c )
889 { print "<option value='$c'>$c</option>\n"; }
890 else { print "<option selected value='$c'>$c</option>\n"; }
892 } elsif ($qossettings{'CLASS'} >= 200 && $qossettings{'CLASS'} < 221) {
893 $qossettings{'DEVICE'} = $qossettings{'IMQ_DEV'};
894 for ( $c = 2000 ; $c <= 2020 ; $c++ )
896 if ( $qossettings{'SCLASS'} ne $c )
897 { print "<option value='$c'>$c</option>\n"; }
898 else { print "<option selected value='$c'>$c</option>\n"; }
903 <td width='33%' align='center'>
904 <tr><td width='33%' align='right'>$Lang::tr{'priority'}:<td width='33%' align='left'><select name='PRIO'>
907 for ( $c = 1 ; $c <= 7 ; $c++ )
909 if ( $qossettings{'PRIO'} ne $c )
910 { print "<option value='$c'>$c</option>\n"; }
911 else { print "<option selected value='$c'>$c</option>\n"; }
914 <td width='33%' align='center'>
915 <tr><td width='33%' align='right'>$Lang::tr{'guaranteed bandwith'}:
916 <td width='33%' align='left'><input type='text' name='MINBWDTH' maxlength='8' required='1' value="$qossettings{'MINBWDTH'}" />
917 <td width='33%' align='center'>
918 <tr><td width='33%' align='right'>$Lang::tr{'max bandwith'}:
919 <td width='33%' align='left'><input type='text' name='MAXBWDTH' maxlength='8' required='1' value="$qossettings{'MAXBWDTH'}" />
920 <td width='33%' align='center'>
921 <tr><td width='33%' align='right'>Burst:
922 <td width='33%' align='left'><input type='text' name='BURST' maxlength='8' value="$qossettings{'BURST'}" />
923 <td width='33%' align='center'>
924 <tr><td width='33%' align='right'>Ceilburst:
925 <td width='33%' align='left'><input type='text' name='CBURST' maxlength='8' value="$qossettings{'CBURST'}" />
926 <td width='33%' align='center'>
927 <tr><td width='33%' align='right'>TOS-Bit:
928 <td width='33%' align='left'><select name='TOS'>
929 <option value='0'>$Lang::tr{'disabled'} (0)</option>
930 <option value='8'>$Lang::tr{'min delay'} (8)</option>
931 <option value='4'>$Lang::tr{'max throughput'} (4)</option>
932 <option value='2'>$Lang::tr{'max reliability'} (2)</option>
933 <option value='1'>$Lang::tr{'min costs'} (1)</option></select>
934 <td width='33%' align='center'><input type='hidden' name='CLASS' value="$qossettings{'CLASS'}" />
935 <input type='hidden' name='DEVICE' value="$qossettings{'DEVICE'}" />
936 <input type='submit' name='DOSCLASS' value='$Lang::tr{'save'}' /> <input type='reset' value='$Lang::tr{'reset'}' />
944 &Header
::openbox
('100%', 'center', $Lang::tr
{'Level7 Rule'});
946 <form method='post' action='$ENV{'SCRIPT_NAME'}'>
950 if ( $message ne "" ) {
951 print "<tr><td colspan='3' align='center'><font color='red'>$message</font>";
954 <tr><td colspan='3' width='100%'>$Lang::tr{'current class'}: $qossettings{'CLASS'}
955 <tr><td width='100%' colspan='3'>$Lang::tr{'enter data'}
956 <tr><td width='33%' align='right'>$Lang::tr{'protocol'}:
957 <td width='33%' align='left'><select name='L7PROT'>
960 opendir( DIR
, "/etc/l7-protocols/protocols" );
961 foreach $direntry ( sort readdir(DIR
) )
963 next if $direntry eq ".";
964 next if $direntry eq "..";
965 next if -d
"/etc/l7-protocols/protocols/$direntry";
966 @proto = split( /\./, $direntry );
967 if ( $proto[0] eq $qossettings{'L7PROT'} ) {
968 print "<option value='$proto[0]' selected>$proto[0]</option>\n";
970 print "<option value='$proto[0]'>$proto[0]</option>\n";
975 </select><td width='33%' align='center'>
976 <tr><td width='33%' align='right'>$Lang::tr{'source ip'}:
977 <td width='33%' align='left'><input type='text' name='QIP' maxlength='15' value='$qossettings{'QIP'}' />
978 <td width='33%' align='center'>
979 <tr><td width='33%' align='right'>$Lang::tr{'destination ip'}:
980 <td width='33%' align='left'><input type='text' name='DIP' maxlength='15' value='$qossettings{'DIP'}' />
981 <td width='33%' align='center'><input type='hidden' name='CLASS' value='$qossettings{'CLASS'}' /><input type='submit' name='DOLEVEL7' value='$Lang::tr{'save'}' />
989 &Header
::openbox
('100%', 'center', $Lang::tr
{'Add Port Rule'});
991 <form method='post' action='$ENV{'SCRIPT_NAME'}'>
993 <tr><td width='100%' colspan='3'>$Lang::tr{'enter data'}
994 <tr><td width='33%' align='right'>$Lang::tr{'protocol'}:
995 <td width='33%' align='left'><select name='PPROT'>
998 open( FILE
, "< /etc/protocols" );
1001 foreach $direntry (sort @proto)
1003 @tmpline = split( /\ /, $direntry );
1004 next if $tmpline[0] =~ "#";
1005 if ( $tmpline[0] eq $qossettings{'PPROT'} ) {
1006 print "<option value='$tmpline[0]' selected>$tmpline[0]</option>\n";
1008 print "<option value='$tmpline[0]'>$tmpline[0]</option>\n";
1012 </select><td width='33%' align='center'>
1013 <tr><td width='33%' align='right'>$Lang::tr{'source port'}:
1014 <td width='33%' align='left'><input type='text' name='QPORT' maxlength='5' value='$qossettings{'QPORT'}' />
1015 <td width='33%' align='center'>
1016 <tr><td width='33%' align='right'>$Lang::tr{'destination port'}:
1017 <td width='33%' align='left'><input type='text' name='DPORT' maxlength='5' value='$qossettings{'DPORT'}' />
1018 <td width='33%' align='center'>
1019 <tr><td width='33%' align='right'>$Lang::tr{'source ip'}:
1020 <td width='33%' align='left'><input type='text' name='QIP' maxlength='15' value='$qossettings{'QIP'}' />
1021 <td width='33%' align='center'>
1022 <tr><td width='33%' align='right'>$Lang::tr{'destination ip'}:
1023 <td width='33%' align='left'><input type='text' name='DIP' maxlength='15' value='$qossettings{'DIP'}' />
1024 <td width='33%' align='center'><input type='hidden' name='CLASS' value='$qossettings{'CLASS'}' /><input type='submit' name='DOPORT' value='$Lang::tr{'save'}' />
1028 &Header
::closebox
();
1032 &Header
::openbox
('100%', 'center', $Lang::tr
{'TOS Rule'});
1033 if ($qossettings{'TOS'}) {
1034 $checked{$qossettings{'TOS'}} = "checked";
1037 <form method='post' action='$ENV{'SCRIPT_NAME'}'>
1041 if ( $message ne "" ) {
1042 print "<tr><td colspan='3' align='center'><font color='red'>$message</font>";
1045 <tr><td colspan='2' width='100%'>$Lang::tr{'current class'}: $qossettings{'CLASS'}
1046 <tr><td width='100%' colspan='2'>$Lang::tr{'Enter TOS'}
1047 <tr><td width='50%' align='left'>$Lang::tr{'min delay'} (8) <td width='50%'><input type="radio" name="TOS" value="8" $checked[8] />
1048 <tr><td width='50%' align='left'>$Lang::tr{'max throughput'} (4) <td width='50%'><input type="radio" name="TOS" value="4" $checked[4] />
1049 <tr><td width='50%' align='left'>$Lang::tr{'max reliability'} (2) <td width='50%'><input type="radio" name="TOS" value="2" $checked[2] />
1050 <tr><td width='50%' align='left'$Lang::tr{'min costs'} (1) <td width='50%'><input type="radio" name="TOS" value="1" $checked[1] />
1051 <tr><td width='100%' align='right' colspan='2'><input type='hidden' name='CLASS' value='$qossettings{'CLASS'}' /><input type='submit' name='DOTOS' value='$Lang::tr{'save'}' />
1055 &Header
::closebox
();
1059 $qossettings{'DEV'} = shift;
1060 open( FILE
, "< $classfile" ) or die "Unable to read $classfile";
1064 open( FILE
, "< $subclassfile" ) or die "Unable to read $subclassfile";
1065 @subclasses = <FILE
>;
1067 open( FILE
, "< $level7file" ) or die "Unable to read $level7file";
1070 open( FILE
, "< $tosfile" ) or die "Unable to read $tosfile";
1073 open( FILE
, "< $portfile" ) or die "Unable to read $portfile";
1074 @portrules = <FILE
>;
1076 foreach $classentry (sort @classes)
1078 @classline = split( /\;/, $classentry );
1079 if ( $classline[0] eq $qossettings{'DEV'} )
1081 &Header
::openbox
('100%', 'center', "Klasse: $classline[1]");
1083 <table border='0' width='100%' cellspacing='0'>
1084 <tr><td bgcolor='$color{'color20'}' width='10%' align='center'><b>$Lang::tr{'interface'}</b>
1085 <td bgcolor='$color{'color20'}' width='10%' align='center'><b>$Lang::tr{'Class'}</b>
1086 <td bgcolor='$color{'color20'}' width='10%' align='center'>$Lang::tr{'priority'}
1087 <td bgcolor='$color{'color20'}' width='10%' align='center'>$Lang::tr{'guaranteed bandwith'}
1088 <td bgcolor='$color{'color20'}' width='10%' align='center'>$Lang::tr{'max bandwith'}
1089 <td bgcolor='$color{'color20'}' width='10%' align='center'>Burst
1090 <td bgcolor='$color{'color20'}' width='10%' align='center'>Ceil Burst
1091 <td bgcolor='$color{'color20'}' width='10%' align='center'>TOS
1092 <td bgcolor='$color{'color20'}' width='20%' align='center'>$Lang::tr{'action'}
1093 <tr><td align='center' bgcolor='$color{'color22'}'>$classline[0]</td>
1094 <td align='center' bgcolor='$color{'color22'}'>$classline[1]</td>
1095 <td align='center' bgcolor='$color{'color22'}'>$classline[2]</td>
1096 <td align='center' bgcolor='$color{'color22'}'>$classline[3]</td>
1097 <td align='center' bgcolor='$color{'color22'}'>$classline[4]</td>
1098 <td align='center' bgcolor='$color{'color22'}'>$classline[5]</td>
1099 <td align='center' bgcolor='$color{'color22'}'>$classline[6]</td>
1100 <td align='center' bgcolor='$color{'color22'}'>$classline[7]</td>
1101 <td align='right' bgcolor='$color{'color22'}'>
1102 <table border='0'><tr>
1103 <td><form method='post' action='$ENV{'SCRIPT_NAME'}'>
1104 <input type='hidden' name='CLASS' value='$classline[1]' />
1105 <input type='hidden' name='ACTION' value='Unterklasse hinzufuegen' />
1106 <input type='image' alt='$Lang::tr{'add subclass'}' src='/images/addblue.gif' />
1108 <td><form method='post' action='$ENV{'SCRIPT_NAME'}'>
1109 <input type='hidden' name='CLASS' value='$classline[1]' />
1110 <input type='hidden' name='ACTION' value='Regel hinzufuegen' />
1111 <input type='image' alt='$Lang::tr{'Add Rule'}' src='/images/addgreen.gif' />
1113 <td><form method='post' action='$ENV{'SCRIPT_NAME'}'>
1114 <input type='hidden' name='CLASS' value='$classline[1]' />
1115 <input type='hidden' name='DOCLASS' value='Bearbeiten' />
1116 <input type='image' alt='$Lang::tr{'edit'}' src='/images/edit.gif' />
1118 <td><form method='post' action='$ENV{'SCRIPT_NAME'}'>
1119 <input type='hidden' name='CLASS' value='$classline[1]' />
1120 <input type='hidden' name='DOCLASS' value='Loeschen' />
1121 <input type='image' alt='$Lang::tr{'delete'}' src='/images/delete.gif' />
1125 <tr><td align='right' colspan='2'><b>$Lang::tr{'remark'}:</b>
1126 <td align='center' colspan='6'> $classline[8]
1127 <td align='right'><b>Queueing:</b> $classline[9]
1132 foreach $l7ruleentry (sort @l7rules)
1134 @l7ruleline = split( /\;/, $l7ruleentry );
1135 if ( $l7ruleline[0] eq $classline[1] )
1138 <tr><td align='right' colspan='2'><b>$Lang::tr{'Level7 Protocol'}:</b>
1139 <td align='center' colspan='6'>$l7ruleline[2]
1141 <table border='0'><tr>
1142 <td><form method='post' action='$ENV{'SCRIPT_NAME'}'>
1143 <input type='hidden' name='CLASS' value='$l7ruleline[0]' />
1144 <input type='hidden' name='L7PROT' value='$l7ruleline[2]' />
1145 <input type='hidden' name='DOLEVEL7' value='Bearbeiten' />
1146 <input type='image' alt='Bearbeiten' src='/images/edit.gif' />
1148 <td><form method='post' action='$ENV{'SCRIPT_NAME'}'>
1149 <input type='hidden' name='CLASS' value='$l7ruleline[0]' />
1150 <input type='hidden' name='L7PROT' value='$l7ruleline[2]' />
1151 <input type='hidden' name='DOLEVEL7' value='Loeschen' />
1152 <input type='image' alt='Loeschen' src='/images/delete.gif' />
1157 if (($l7ruleline[3] ne "") || ($l7ruleline[4] ne "")){
1159 <tr><td align='center'>
1160 <td align='right' colspan='3'><b>$Lang::tr{'source ip'}:</b> $l7ruleline[3]
1161 <td align='right' colspan='3'><b>$Lang::tr{'destination ip'}:</b> $l7ruleline[4]
1175 foreach $portruleentry (sort @portrules)
1177 @portruleline = split( /\;/, $portruleentry );
1178 if ( $portruleline[0] eq $classline[1] )
1181 <tr><td align='right' colspan='2'><b>$Lang::tr{'Port Rule'}:</b>
1182 <td align='center'>($portruleline[2])
1183 <td align='center' colspan='2'>
1186 if ($portruleline[4]) {
1188 <i>Quell-Port:</i> $portruleline[4]
1192 print "<td align='center' colspan='2'>";
1193 if ($portruleline[6]) {
1195 <i>Ziel-Port:</i> $portruleline[6]
1202 <table border='0'><tr>
1203 <td><form method='post' action='$ENV{'SCRIPT_NAME'}'>
1204 <input type='hidden' name='CLASS' value='$portruleline[0]' />
1205 <input type='hidden' name='PPROT' value='$portruleline[2]' />
1206 <input type='hidden' name='QIP' value='$portruleline[3]' />
1207 <input type='hidden' name='QPORT' value='$portruleline[4]' />
1208 <input type='hidden' name='DIP' value='$portruleline[5]' />
1209 <input type='hidden' name='DPORT' value='$portruleline[6]' />
1210 <input type='hidden' name='DOPORT' value='Bearbeiten' />
1211 <input type='image' alt='$Lang::tr{'edit'}' src='/images/edit.gif' />
1213 <td><form method='post' action='$ENV{'SCRIPT_NAME'}'>
1214 <input type='hidden' name='CLASS' value='$portruleline[0]' />
1215 <input type='hidden' name='PPROT' value='$portruleline[2]' />
1216 <input type='hidden' name='QIP' value='$portruleline[3]' />
1217 <input type='hidden' name='QPORT' value='$portruleline[4]' />
1218 <input type='hidden' name='DIP' value='$portruleline[5]' />
1219 <input type='hidden' name='DPORT' value='$portruleline[6]' />
1220 <input type='hidden' name='DOPORT' value='Loeschen' />
1221 <input type='image' alt='$Lang::tr{'delete'}' src='/images/delete.gif' />
1226 if (($portruleline[3] ne "") || ($portruleline[5] ne "")){
1228 <tr><td align='center'>
1229 <td align='right' colspan='3'><b>$Lang::tr{'source ip'}:</b> $portruleline[3]
1230 <td align='right' colspan='3'><b>$Lang::tr{'destination ip'}:</b> $portruleline[5]
1239 foreach $tosruleentry (sort @tosrules)
1241 @tosruleline = split( /\;/, $tosruleentry );
1242 if ( $tosruleline[0] eq $classline[1] )
1245 <tr><td align='right' colspan='2'>
1246 <b>TOS Bit matches:</b>
1247 <td colspan='6' align='center'>
1250 if ( $tosruleline[2] eq "8") {
1251 print "$Lang::tr{'min delay'}\n";
1252 } elsif ( $tosruleline[2] eq "4") {
1253 print "$Lang::tr{'max throughput'}\n";
1254 } elsif ( $tosruleline[2] eq "2") {
1255 print "$Lang::tr{'max reliability'}\n";
1256 } elsif ( $tosruleline[2] eq "1") {
1257 print "$Lang::tr{'min costs'}\n";
1258 } else { print " \n"; }
1263 <table border='0'><tr>
1264 <td><form method='post' action='$ENV{'SCRIPT_NAME'}'>
1265 <input type='hidden' name='CLASS' value='$tosruleline[0]' />
1266 <input type='hidden' name='DEV' value='$tosruleline[1]' />
1267 <input type='hidden' name='TOS' value='$tosruleline[2]' />
1268 <input type='hidden' name='DOTOS' value='Bearbeiten' />
1269 <input type='image' alt='$Lang::tr{'edit'}' src='/images/edit.gif' />
1271 <td><form method='post' action='$ENV{'SCRIPT_NAME'}'>
1272 <input type='hidden' name='CLASS' value='$tosruleline[0]' />
1273 <input type='hidden' name='DEV' value='$tosruleline[1]' />
1274 <input type='hidden' name='TOS' value='$tosruleline[2]' />
1275 <input type='hidden' name='DOTOS' value='Loeschen' />
1276 <input type='image' alt='$Lang::tr{'delete'}' src='/images/delete.gif' />
1286 foreach $subclassentry (sort @subclasses)
1288 @subclassline = split( /\;/, $subclassentry );
1289 if ( $subclassline[1] eq $classline[1] ) {
1291 <tr><td align='center' bgcolor='#FAFAFA'>$Lang::tr{'Subclass'}:
1292 <td align='center' bgcolor='#FAFAFA'>$subclassline[2]
1293 <td align='center' bgcolor='#FAFAFA'>$subclassline[3]
1294 <td align='center' bgcolor='#FAFAFA'>$subclassline[4]
1295 <td align='center' bgcolor='#FAFAFA'>$subclassline[5]
1296 <td align='center' bgcolor='#FAFAFA'>$subclassline[6]
1297 <td align='center' bgcolor='#FAFAFA'>$subclassline[7]
1298 <td align='center' bgcolor='#FAFAFA'>$subclassline[8]
1299 <td align='right' bgcolor='#FAFAFA'>
1300 <table border='0'><tr>
1301 <td><form method='post' action='$ENV{'SCRIPT_NAME'}'>
1302 <input type='hidden' name='CLASS' value='$subclassline[2]' />
1303 <input type='hidden' name='ACTION' value='Regel hinzufuegen' />
1304 <input type='image' alt='$Lang::tr{'Add Rule'}' src='/images/addgreen.gif' />
1306 <td><form method='post' action='$ENV{'SCRIPT_NAME'}'>
1307 <input type='hidden' name='CLASS' value='$subclassline[2]' />
1308 <input type='hidden' name='DOSCLASS' value='Bearbeiten' />
1309 <input type='image' alt='$Lang::tr{'edit'}' src='/images/edit.gif' />
1311 <td><form method='post' action='$ENV{'SCRIPT_NAME'}'>
1312 <input type='hidden' name='CLASS' value='$subclassline[2]' />
1313 <input type='hidden' name='DOSCLASS' value='Loeschen' />
1314 <input type='image' alt='$Lang::tr{'delete'}' src='/images/delete.gif' />
1325 &Header
::closebox
();
1333 &Header
::openbox
('100%', 'center', $Lang::tr
{'expertoptions'});
1335 <form method='post' action='$ENV{'SCRIPT_NAME'}'>
1337 <tr><td width='33%' align='right'>MTU:<td width='33%' align='left'>
1338 <input type='text' name='MTU' maxlength='8' required='4' value='$qossettings{'MTU'}' />
1339 <td width='33%' align='center'>$Lang::tr{'mtu QoS'}
1340 <tr><td width='33%' align='right'>$Lang::tr{'Queuelenght'}:<td width='33%' align='left'>
1341 <input type='text' name='QLENGTH' maxlength='8' required='2' value='$qossettings{'QLENGTH'}' />
1342 <td width='33%' align='center'>
1343 <tr><td width='33%' align='right'>SFQ Perturb:<td width='33%' align='left'>
1344 <input type='text' name='SFQ_PERTUB' maxlength='8' required='1' value='$qossettings{'SFQ_PERTUB'}' />
1345 <td width='33%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'save'}' />
1350 &Header
::closebox
();
1354 if ( $qossettings{'VALID'} eq 'yes' ) {
1355 if ( $qossettings{'DEVICE'} eq $qossettings{'RED_DEV'} ) {
1356 $qossettings{'SPD'} = $qossettings{'OUT_SPD'};
1357 } elsif ( $qossettings{'DEVICE'} eq $qossettings{'IMQ_DEV'} ) {
1358 $qossettings{'SPD'} = $qossettings{'INC_SPD'};
1360 unless ( ( $qossettings{'MINBWDTH'} >= 1 ) && ( $qossettings{'MINBWDTH'} <= $qossettings{'SPD'} ) ) {
1361 $qossettings{'VALID'} = 'no';
1362 $message = "$Lang::tr{'false min bandwith'}";
1364 $qossettings{'SPD'} = '';
1369 if ( $qossettings{'VALID'} eq 'yes' ) {
1370 if ( $qossettings{'DEVICE'} eq $qossettings{'RED_DEV'} ) {
1371 $qossettings{'SPD'} = $qossettings{'OUT_SPD'};
1372 } elsif ( $qossettings{'DEVICE'} eq $qossettings{'IMQ_DEV'} ) {
1373 $qossettings{'SPD'} = $qossettings{'INC_SPD'};
1375 unless ( ( $qossettings{'MAXBDWTH'} >= 0 ) && ($qossettings{'MAXBDWTH'} >= $qossettings{'MINBDWTH'}) &&( $qossettings{'MAXBDWTH'} <= $qossettings{'SPD'} ) ) {
1376 $qossettings{'VALID'} = 'no';
1377 $message = "$Lang::tr{'false max bandwith'}";
1379 $qossettings{'SPD'} = '';
1384 if ( $qossettings{'VALID'} eq 'yes' ) {
1385 if ( $qossettings{'DEVICE'} eq $qossettings{'RED_DEV'} ) {
1386 if ($qossettings{'CLASS'} lt 100 || $qossettings{'CLASS'} ge 121) {
1387 $qossettings{'VALID'} = 'no';
1388 $message = "$Lang::tr{'false classnumber'}";
1390 } elsif ( $qossettings{'DEVICE'} eq $qossettings{'IMQ_DEV'} ) {
1391 if ($qossettings{'CLASS'} lt 200 || $qossettings{'CLASS'} ge 221) {
1392 $qossettings{'VALID'} = 'no';
1393 $message = "Die Klassennummer passt nicht zum angegebenen Interface.";
1396 open( FILE
, "< $classfile" ) or die "Unable to read $classfile";
1399 foreach $classentry (sort @tmp)
1401 @tmpline = split( /\;/, $classentry );
1402 if ( $tmpline[1] eq $qossettings{'CLASS'} )
1404 $qossettings{'VALID'} = 'no';
1405 $message = "$Lang::tr{'false classnumber'}";
1413 if ( $qossettings{'VALID'} eq 'yes' ) {
1414 open( FILE
, "< $subclassfile" ) or die "Unable to read $subclassfile";
1417 foreach $subclassentry (sort @tmp)
1419 @tmpline = split( /\;/, $subclassentry );
1420 if ( $tmpline[2] eq $qossettings{'SCLASS'} )
1422 $qossettings{'VALID'} = 'no';
1423 $message = "$Lang::tr{'class in use'}";