]>
git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - html/cgi-bin/qos.cgi
5 # This code is distributed under the terms of the GPL
11 # enable only the following on debugging purpose
13 use CGI
:: Carp
'fatalsToBrowser' ;
15 require '/var/ipfire/general-functions.pl' ;
16 require "${General::swroot}/lang.pl" ;
17 require "${General::swroot}/header.pl" ;
22 my $errormessage = "" ;
23 & General
:: readhash
( "${General::swroot}/ethernet/settings" , \
%netsettings );
25 & Header
:: showhttpheaders
();
27 $qossettings { 'ACTION' } = '' ;
28 $qossettings { 'ACTION_BW' } = '' ;
29 $qossettings { 'ENABLED' } = '' ;
30 $qossettings { 'OUT_SPD' } = '' ;
31 $qossettings { 'INC_SPD' } = '' ;
32 $qossettings { 'RED_DEV' } = `cat /var/ipfire/red/iface` ;
33 $qossettings { 'IMQ_DEV' } = 'imq0' ;
35 & General
:: readhash
( "${General::swroot}/qos/settings" , \
%qossettings );
36 & Header
:: getcgihash
( \
%qossettings );
38 & Header
:: openpage
( 'QoS' , 1 , '' );
40 & Header
:: openbigbox
( '100%' , 'left' , '' , $errormessage );
43 if ( $qossettings { 'ACTION' } eq 'Start' )
45 system ( "/bin/touch /var/ipfire/qos/enable" );
46 $qossettings { 'ENABLED' } = 'on' ;
47 & General
:: writehash
( "${General::swroot}/qos/settings" , \
%qossettings );
49 elsif ( $qossettings { 'ACTION' } eq 'Stop' )
51 unlink "/var/ipfire/qos/enable" ;
52 $qossettings { 'ENABLED' } = 'off' ;
53 & General
:: writehash
( "${General::swroot}/qos/settings" , \
%qossettings );
55 elsif ( $qossettings { 'ACTION' } eq $Lang :: tr
{ 'save' })
57 & General
:: writehash
( "${General::swroot}/qos/settings" , \
%qossettings );
59 if ( $qossettings { 'ACTION_BW' } eq 'Andern' )
61 & Header
:: openbox
( '100%' , 'center' , 'Bandbreiteneinstellungen' );
62 if ( $qossettings { 'ENABLED' } eq 'on' ) {
63 print "Sie koennen die Bandbreiteneinstellungen nicht bearbeiten, wenn QoS eingeschaltet ist. Schalten sie es zuerst dazu aus.<p>" ;
64 print "<a href='/cgi-bin/qos.cgi'>Zurueck</a>" ;
67 <form method='post' action=' $ENV {'SCRIPT_NAME'}'>
69 <tr><td width='100%' colspan='3'>Geben Sie bitte hier ihre Download- bzw. Upload-Geschwindigkeit ein <br> und klicken Sie danach auf <i>Speichern</i>.
70 <tr><td width='33%' align='right'>Download-Geschwindigkeit:<td width='33%' align='left'><input type='text' name='INC_SPD' maxlength='8' value= $qossettings {'INC_SPD'}> kbps<td width='33%' align='center'>
71 <tr><td width='33%' align='right'>Upload-Geschwindigkeit:<td width='33%' align='left'><input type='text' name='OUT_SPD' maxlength='8'value= $qossettings {'OUT_SPD'}> kbps<td width='33%' align='center'><input type='submit' name='ACTION' value= $Lang ::tr{'save'} />
78 & Header
:: closebigbox
();
83 & General
:: readhash
( "${General::swroot}/qos/settings" , \
%qossettings );
85 my $status = $Lang :: tr
{ 'stopped' };
86 my $statuscolor = $Header :: colourred
;
87 if ( $qossettings { 'ENABLED' } eq 'on' ) {
88 $status = $Lang :: tr
{ 'running' };
89 $statuscolor = $Header :: colourgreen
;
92 if ( $netsettings { 'RED_TYPE' } ne 'PPPOE' ) {
93 $qossettings { 'RED_DEV' } = $netsettings { 'RED_DEV' };
97 & Header
:: openbox
( '100%' , 'left' , $Lang :: tr
{ 'error messages' });
98 print "<class name='base'> $errormessage \n " ;
99 print " </class> \n " ;
103 & Header
:: openbox
( '100%' , 'center' , 'Quality of Service' );
105 <form method='post' action=' $ENV {'SCRIPT_NAME'}'>
107 <tr><td width='50%' align='left'><b>Quality of Service:</b>
108 <td width='50%' align='center' bgcolor=' $statuscolor '><font color='white'> $status </font>
109 <tr><td width='100%' align='center' colspan='2'> <input type='submit' name='ACTION' value='Start' />
110 <input type='submit' name='ACTION' value='Stop' />
111 <input type='submit' name='ACTION' value=' $Lang ::tr{'restart'}' />
114 if (( $qossettings { 'OUT_SPD' } ne '' ) && ( $qossettings { 'INC_SPD' } ne '' )) {
116 <tr><td colspan='3'>
117 <tr><td width='40%' align='right'>Downloadgeschwindigkeit: <td width='40%' align='left'> $qossettings {'INC_SPD'} <td width='20%' rowspan='2' align='center' valign='middle'><input type='submit' name='ACTION_BW' value='Andern'>
118 <tr><td width='40%' align='right'>Uploadgeschwindigkeit: <td width='40%' align='left'> $qossettings {'OUT_SPD'}
126 if ( ( $qossettings { 'OUT_SPD' } eq '' ) || ( $qossettings { 'INC_SPD' } eq '' ) ) {
127 & Header
:: openbox
( '100%' , 'center' , "Outgoing ( $qossettings {'RED_DEV'})" );
130 <tr><td width='100%' colspan='3'>Geben Sie bitte hier ihre Download- bzw. Upload-Geschwindigkeit ein <br> und klicken Sie danach auf <i>Speichern</i>.
131 <tr><td width='33%' align='right'>Download-Geschwindigkeit:<td width='33%' align='left'><input type='text' name='INC_SPD' maxlength='8'> kbps<td width='33%' align='center'>
132 <tr><td width='33%' align='right'>Upload-Geschwindigkeit:<td width='33%' align='left'><input type='text' name='OUT_SPD' maxlength='8'> kbps<td width='33%' align='center'><input type='submit' name='ACTION' value= $Lang ::tr{'save'} />
138 & Header
:: closebigbox
();
139 & Header
:: closepage
();
143 if ( $qossettings { 'RED_DEV' } ne '' ) {
144 & Header
:: openbox
( '100%' , 'center' , 'Outgoing Interface' );
146 <table border='0' width='100%' cellspacing='0'>
147 <tr><td bgcolor='lightgrey' width='20%'>Interface<td bgcolor='lightgrey' width='20%'>Klasse<td bgcolor='lightgrey' width='20%'>Maximale Geschwindigkeit<td bgcolor='lightgrey' width='40%'>Aktionen
148 <tr><td bgcolor='black' height='2px' colspan='4'>
149 <tr><td>ppp0<td>198<td>512<td>BLA
150 <tr><td bgcolor='lightgrey'>ppp0<td bgcolor='lightgrey'>199<td bgcolor='lightgrey'>512<td bgcolor='lightgrey'>BLA
156 & Header
:: openbox
( '100%' , 'center' , 'Outgoing Interface' );
157 print "Es ist kein rotes Interface vorhanden." ;
159 & Header
:: closebigbox
();
160 & Header
:: closepage
();
164 & Header
:: closebigbox
();
165 & Header
:: closepage
();