]>
git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - html/cgi-bin/outgoingfw.cgi
2 ###############################################################################
4 # IPFire.org - A linux based firewall #
5 # Copyright (C) 2007 Michael Tremer & Christian Schmidt #
7 # This program is free software: you can redistribute it and/or modify #
8 # it under the terms of the GNU General Public License as published by #
9 # the Free Software Foundation, either version 3 of the License, or #
10 # (at your option) any later version. #
12 # This program is distributed in the hope that it will be useful, #
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15 # GNU General Public License for more details. #
17 # You should have received a copy of the GNU General Public License #
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
20 ###############################################################################
23 # enable only the following on debugging purpose
25 #use CGI::Carp 'fatalsToBrowser';
27 require '/var/ipfire/general-functions.pl' ;
28 require "${General::swroot}/lang.pl" ;
29 require "${General::swroot}/header.pl" ;
31 my %outfwsettings = ();
35 my $errormessage = "" ;
43 my $configfile = "/var/ipfire/outgoing/rules" ;
44 my $p2pfile = "/var/ipfire/outgoing/p2protocols" ;
45 my $servicefile = "/var/ipfire/outgoing/defaultservices" ;
48 my %mainsettings = ();
49 & General
:: readhash
( "${General::swroot}/main/settings" , \
%mainsettings );
50 & General
:: readhash
( "/srv/web/ipfire/html/themes/" . $mainsettings { 'THEME' }. "/include/colors.txt" , \
%color );
52 & General
:: readhash
( "${General::swroot}/ethernet/settings" , \
%netsettings );
54 & Header
:: showhttpheaders
();
56 ### Values that have to be initialized
57 $outfwsettings { 'ACTION' } = '' ;
58 $outfwsettings { 'VALID' } = 'yes' ;
59 $outfwsettings { 'EDIT' } = 'no' ;
60 $outfwsettings { 'NAME' } = '' ;
61 $outfwsettings { 'SNET' } = '' ;
62 $outfwsettings { 'SIP' } = '' ;
63 $outfwsettings { 'SPORT' } = '' ;
64 $outfwsettings { 'SMAC' } = '' ;
65 $outfwsettings { 'DIP' } = '' ;
66 $outfwsettings { 'DPORT' } = '' ;
67 $outfwsettings { 'PROT' } = '' ;
68 $outfwsettings { 'STATE' } = '' ;
69 $outfwsettings { 'DISPLAY_DIP' } = '' ;
70 $outfwsettings { 'DISPLAY_DPORT' } = '' ;
71 $outfwsettings { 'DISPLAY_SMAC' } = '' ;
72 $outfwsettings { 'DISPLAY_SIP' } = '' ;
73 $outfwsettings { 'POLICY' } = 'MODE0' ;
74 $outfwsettings { 'MODE1LOG' } = 'off' ;
76 & General
:: readhash
( "${General::swroot}/outgoing/settings" , \
%outfwsettings );
77 & Header
:: getcgihash
( \
%outfwsettings );
79 $checked { 'MODE1LOG' }{ 'off' } = '' ;
80 $checked { 'MODE1LOG' }{ 'on' } = '' ;
81 $checked { 'MODE1LOG' }{ $outfwsettings { 'MODE1LOG' }} = "checked='checked'" ;
83 if ( $outfwsettings { 'POLICY' } eq 'MODE0' ){ $selected { 'POLICY' }{ 'MODE0' } = 'selected' ; } else { $selected { 'POLICY' }{ 'MODE0' } = '' ; }
84 if ( $outfwsettings { 'POLICY' } eq 'MODE1' ){ $selected { 'POLICY' }{ 'MODE1' } = 'selected' ; } else { $selected { 'POLICY' }{ 'MODE1' } = '' ; }
85 if ( $outfwsettings { 'POLICY' } eq 'MODE2' ){ $selected { 'POLICY' }{ 'MODE2' } = 'selected' ; } else { $selected { 'POLICY' }{ 'MODE2' } = '' ; }
87 & Header
:: openpage
( 'Ausgehende Firewall' , 1 , '' );
88 & Header
:: openbigbox
( '100%' , 'left' , '' , $errormessage );
90 ############################################################################################################################
91 ############################################################################################################################
93 if ( $outfwsettings { 'ACTION' } eq $Lang :: tr
{ 'reset' })
95 $outfwsettings { 'POLICY' }= 'MODE0' ;
97 system ( "/usr/bin/touch $configfile " );
98 my $MODE = $outfwsettings { 'POLICY' };
100 $outfwsettings { 'POLICY' } = " $MODE " ;
101 & General
:: writehash
( "${General::swroot}/outgoing/settings" , \
%outfwsettings );
103 if ( $outfwsettings { 'ACTION' } eq $Lang :: tr
{ 'save' })
105 my $MODE = $outfwsettings { 'POLICY' };
106 my $MODE1LOG = $outfwsettings { 'MODE1LOG' };
108 $outfwsettings { 'POLICY' } = " $MODE " ;
109 $outfwsettings { 'MODE1LOG' } = " $MODE1LOG " ;
110 & General
:: writehash
( "${General::swroot}/outgoing/settings" , \
%outfwsettings );
111 system ( "/usr/local/bin/outgoingfwctrl" );
113 if ( $outfwsettings { 'ACTION' } eq 'enable' )
115 open ( FILE
, "< $p2pfile " ) or die "Unable to read $p2pfile " ;
118 open ( FILE
, "> $p2pfile " ) or die "Unable to write $p2pfile " ;
119 foreach $p2pentry ( sort @p2ps )
121 @p2pline = split ( /\;/ , $p2pentry );
122 if ( $p2pline [ 1 ] eq $outfwsettings { 'P2PROT' }) {
123 print FILE
" $p2pline [0]; $p2pline [1];on; \n " ;
125 print FILE
" $p2pline [0]; $p2pline [1]; $p2pline [2]; \n " ;
129 system ( "/usr/local/bin/outgoingfwctrl" );
131 if ( $outfwsettings { 'ACTION' } eq 'disable' )
133 open ( FILE
, "< $p2pfile " ) or die "Unable to read $p2pfile " ;
136 open ( FILE
, "> $p2pfile " ) or die "Unable to write $p2pfile " ;
137 foreach $p2pentry ( sort @p2ps )
139 @p2pline = split ( /\;/ , $p2pentry );
140 if ( $p2pline [ 1 ] eq $outfwsettings { 'P2PROT' }) {
141 print FILE
" $p2pline [0]; $p2pline [1];off; \n " ;
143 print FILE
" $p2pline [0]; $p2pline [1]; $p2pline [2]; \n " ;
147 system ( "/usr/local/bin/outgoingfwctrl" );
149 if ( $outfwsettings { 'ACTION' } eq $Lang :: tr
{ 'edit' })
151 open ( FILE
, "< $configfile " ) or die "Unable to read $configfile " ;
154 open ( FILE
, "> $configfile " ) or die "Unable to write $configfile " ;
155 foreach $configentry ( sort @configs )
157 @configline = split ( /\;/ , $configentry );
158 unless (( $configline [ 0 ] eq $outfwsettings { 'STATE' }) &&
159 ( $configline [ 1 ] eq $outfwsettings { 'ENABLED' }) &&
160 ( $configline [ 2 ] eq $outfwsettings { 'SNET' }) &&
161 ( $configline [ 3 ] eq $outfwsettings { 'PROT' }) &&
162 ( $configline [ 4 ] eq $outfwsettings { 'NAME' }) &&
163 ( $configline [ 5 ] eq $outfwsettings { 'SIP' }) &&
164 ( $configline [ 6 ] eq $outfwsettings { 'SMAC' }) &&
165 ( $configline [ 7 ] eq $outfwsettings { 'DIP' }) &&
166 ( $configline [ 9 ] eq $outfwsettings { 'LOG' }) &&
167 ( $configline [ 8 ] eq $outfwsettings { 'DPORT' }))
169 print FILE
$configentry ;
173 $selected { 'SNET' }{ " $outfwsettings {'SNET'}" } = 'selected' ;
174 $selected { 'PROT' }{ " $outfwsettings {'PROT'}" } = 'selected' ;
175 $selected { 'LOG' }{ " $outfwsettings {'LOG'}" } = 'selected' ;
177 & Header
:: closebigbox
();
178 & Header
:: closepage
();
180 system ( "/usr/local/bin/outgoingfwctrl" );
182 if ( $outfwsettings { 'ACTION' } eq $Lang :: tr
{ 'delete' })
184 open ( FILE
, "< $configfile " ) or die "Unable to read $configfile " ;
187 open ( FILE
, "> $configfile " ) or die "Unable to write $configfile " ;
188 foreach $configentry ( sort @configs )
190 @configline = split ( /\;/ , $configentry );
191 unless (( $configline [ 0 ] eq $outfwsettings { 'STATE' }) &&
192 ( $configline [ 1 ] eq $outfwsettings { 'ENABLED' }) &&
193 ( $configline [ 2 ] eq $outfwsettings { 'SNET' }) &&
194 ( $configline [ 3 ] eq $outfwsettings { 'PROT' }) &&
195 ( $configline [ 4 ] eq $outfwsettings { 'NAME' }) &&
196 ( $configline [ 5 ] eq $outfwsettings { 'SIP' }) &&
197 ( $configline [ 6 ] eq $outfwsettings { 'SMAC' }) &&
198 ( $configline [ 7 ] eq $outfwsettings { 'DIP' }) &&
199 ( $configline [ 9 ] eq $outfwsettings { 'LOG' }) &&
200 ( $configline [ 8 ] eq $outfwsettings { 'DPORT' }))
202 print FILE
$configentry ;
206 system ( "/usr/local/bin/outgoingfwctrl" );
208 if ( $outfwsettings { 'ACTION' } eq $Lang :: tr
{ 'add' })
210 if ( $outfwsettings { 'VALID' } eq 'yes' ) {
211 open ( FILE
, ">> $configfile " ) or die "Unable to write $configfile " ;
213 $outfwsettings {'STATE'}; $outfwsettings {'ENABLED'}; $outfwsettings {'SNET'}; $outfwsettings {'PROT'}; $outfwsettings {'NAME'}; $outfwsettings {'SIP'}; $outfwsettings {'SMAC'}; $outfwsettings {'DIP'}; $outfwsettings {'DPORT'}; $outfwsettings {'LOG'};
217 system ( "/usr/local/bin/outgoingfwctrl" );
219 $outfwsettings { 'ACTION' } = 'Add rule' ;
222 if ( $outfwsettings { 'ACTION' } eq 'Add rule' )
228 & General
:: readhash
( "${General::swroot}/outgoing/settings" , \
%outfwsettings );
231 & Header
:: openbox
( '100%' , 'left' , $Lang :: tr
{ 'error messages' });
232 print "<class name='base'> $errormessage \n " ;
233 print " </class> \n " ;
237 ############################################################################################################################
238 ############################################################################################################################
240 if ( $outfwsettings { 'POLICY' } ne 'MODE0' ){
241 & Header
:: openbox
( '100%' , 'center' , 'Rules' );
243 <form method='post' action=' $ENV {'SCRIPT_NAME'}'>
244 <input type='submit' name='ACTION' value='Add rule' />
248 open ( FILE
, "< $configfile " ) or die "Unable to read $configfile " ;
254 <table border='0' width='100%' cellspacing='0'>
255 <tr bgcolor=' $color {'color22'}'>
256 <td width='14%' align='center'><b>Protokoll</b>
257 <td width='14%' align='center'><b>Netzwerk</b>
258 <td width='14%' align='center'><b>Ziel</b>
259 <td width='14%' align='center'><b>Anmerkung</b>
260 <td width='14%' align='center'><b>Politik</b>
261 <td width='16%' align='center'><b>Logging</b>
262 <td width='14%' align='center'><b>Aktionen</b>
265 foreach $configentry ( sort @configs )
267 @configline = split ( /\;/ , $configentry );
268 $outfwsettings { 'STATE' } = $configline [ 0 ];
269 $outfwsettings { 'ENABLED' } = $configline [ 1 ];
270 $outfwsettings { 'SNET' } = $configline [ 2 ];
271 $outfwsettings { 'PROT' } = $configline [ 3 ];
272 $outfwsettings { 'NAME' } = $configline [ 4 ];
273 $outfwsettings { 'SIP' } = $configline [ 5 ];
274 $outfwsettings { 'SMAC' } = $configline [ 6 ];
275 $outfwsettings { 'DIP' } = $configline [ 7 ];
276 $outfwsettings { 'DPORT' } = $configline [ 8 ];
277 $outfwsettings { 'LOG' } = $configline [ 9 ];
278 if ( $outfwsettings { 'DIP' } eq '' ){ $outfwsettings { 'DISPLAY_DIP' } = 'ALL' ; } else { $outfwsettings { 'DISPLAY_DIP' } = $outfwsettings { 'DIP' }; }
279 if ( $outfwsettings { 'DPORT' } eq '' ){ $outfwsettings { 'DISPLAY_DPORT' } = 'ALL' ; } else { $outfwsettings { 'DISPLAY_DPORT' } = $outfwsettings { 'DPORT' }; }
280 if ( $outfwsettings { 'STATE' } eq 'DENY' ){ $outfwsettings { 'DISPLAY_STATE' } = "<img src='/images/stock_stop.png' alt='DENY' />" ; }
281 if ( $outfwsettings { 'STATE' } eq 'ALLOW' ){ $outfwsettings { 'DISPLAY_STATE' } = "<img src='/images/stock_ok.png' alt='ALLOW' />" ; }
282 if ((( $outfwsettings { 'POLICY' } eq 'MODE1' ) && ( $outfwsettings { 'STATE' } eq 'ALLOW' )) || (( $outfwsettings { 'POLICY' } eq 'MODE2' ) && ( $outfwsettings { 'STATE' } eq 'DENY' ))){
284 <tr bgcolor=' $color {'color20'}'>
285 <td align='center'> $outfwsettings {'PROT'}
286 <td align='center'> $outfwsettings {'SNET'}
287 <td align='center'> $outfwsettings {'DISPLAY_DIP'}: $outfwsettings {'DISPLAY_DPORT'}
288 <td align='center'> $outfwsettings {'NAME'}
289 <td align='center'> $outfwsettings {'DISPLAY_STATE'}
290 <td align='center'> $outfwsettings {'LOG'}
292 <table border='0' cellpadding='0' cellspacing='0'><tr>
293 <td><form method='post' action=' $ENV {'SCRIPT_NAME'}'>
294 <input type='hidden' name='PROT' value=' $outfwsettings {'PROT'}' />
295 <input type='hidden' name='STATE' value=' $outfwsettings {'STATE'}' />
296 <input type='hidden' name='SNET' value=' $outfwsettings {'SNET'}' />
297 <input type='hidden' name='DPORT' value=' $outfwsettings {'DPORT'}' />
298 <input type='hidden' name='DIP' value=' $outfwsettings {'DIP'}' />
299 <input type='hidden' name='SIP' value=' $outfwsettings {'SIP'}' />
300 <input type='hidden' name='NAME' value=' $outfwsettings {'NAME'}' />
301 <input type='hidden' name='SMAC' value=' $outfwsettings {'SMAC'}' />
302 <input type='hidden' name='ENABLED' value=' $outfwsettings {'ENABLED'}' />
303 <input type='hidden' name='LOG' value=' $outfwsettings {'LOG'}' />
304 <input type='hidden' name='ACTION' value= $Lang ::tr{'edit'} />
305 <input type='image' src='/images/edit.gif' width="20" height="20" alt= $Lang ::tr{'edit'} />
307 <td><form method='post' action=' $ENV {'SCRIPT_NAME'}'>
308 <input type='hidden' name='PROT' value=' $outfwsettings {'PROT'}' />
309 <input type='hidden' name='STATE' value=' $outfwsettings {'STATE'}' />
310 <input type='hidden' name='SNET' value=' $outfwsettings {'SNET'}' />
311 <input type='hidden' name='DPORT' value=' $outfwsettings {'DPORT'}' />
312 <input type='hidden' name='DIP' value=' $outfwsettings {'DIP'}' />
313 <input type='hidden' name='SIP' value=' $outfwsettings {'SIP'}' />
314 <input type='hidden' name='NAME' value=' $outfwsettings {'NAME'}' />
315 <input type='hidden' name='SMAC' value=' $outfwsettings {'SMAC'}' />
316 <input type='hidden' name='ENABLED' value=' $outfwsettings {'ENABLED'}' />
317 <input type='hidden' name='LOG' value=' $outfwsettings {'LOG'}' />
318 <input type='hidden' name='ACTION' value= $Lang ::tr{'delete'} />
319 <input type='image' src='/images/delete.gif' width="20" height="20" alt= $Lang ::tr{'delete'} />
323 if (( $outfwsettings { 'SIP' }) || ( $outfwsettings { 'SMAC' })) {
324 unless ( $outfwsettings { 'SIP' }) { $outfwsettings { 'DISPLAY_SIP' } = 'ALL' ; } else { $outfwsettings { 'DISPLAY_SIP' } = $outfwsettings { 'SIP' }; }
325 unless ( $outfwsettings { 'SMAC' }) { $outfwsettings { 'DISPLAY_SMAC' } = 'ALL' ; } else { $outfwsettings { 'DISPLAY_SMAC' } = $outfwsettings { 'SMAC' }; }
327 <tr><td width='14%' align='right'>Quell-IP-Adresse:
328 <td width='14%' align='left'> $outfwsettings {'DISPLAY_SIP'}
329 <td width='14%' align='right'>Quell-MAC-Adresse:
330 <td width='14%' align='left'> $outfwsettings {'DISPLAY_SMAC'}
331 <td width='44%' colspan='2' align='center'>
341 if ( $outfwsettings { 'POLICY' } eq 'MODE1' ){
343 <tr bgcolor=' $color {'color20'}'><form method='post' action=' $ENV {'SCRIPT_NAME'}'>
344 <td align='center'>tcp&udp
345 <td align='center'>all
346 <td align='center'>ALL
347 <td align='center'>drop
348 <td align='center'><img src='/images/stock_stop.png' alt='DENY' />
349 <td align='center'>on <input type='radio' name='MODE1LOG' value='on' $checked {'MODE1LOG'}{'on'} /><input type='radio' name='MODE1LOG' value='off' $checked {'MODE1LOG'}{'off'} /> off
350 <td align='center'><input type='hidden' name='ACTION' value= $Lang ::tr{'save'} /><input type='image' src='/images/media-floppy.png' width="18" height="18" alt= $Lang ::tr{'save'} /></form></tr>
351 <table border='0' cellpadding='0' cellspacing='0'><tr>
366 if ( $outfwsettings { 'POLICY' } ne 'MODE0' ){
367 open ( FILE
, "< $p2pfile " ) or die "Unable to read $p2pfile " ;
370 & Header
:: openbox
( '100%' , 'center' , 'P2P-Block' );
373 <tr bgcolor=' $color {'color22'}'><td width='66%' align=center><b>Protokoll</b>
374 <td width='33%' align=center><b>Status</b>
378 foreach $p2pentry ( sort @p2ps )
380 @p2pline = split ( /\;/ , $p2pentry );
382 <form method='post' action=' $ENV {'SCRIPT_NAME'}'>
385 print " \t\t\t <tr bgcolor=' $color {'color20'}'> \n " ;
387 <td width='66%' align='center'> $p2pline [0]:
388 <td width='33%' align='center'><input type='hidden' name='P2PROT' value=' $p2pline [1]' />
391 if ( $p2pline [ 2 ] eq 'on' ) {
393 <input type='hidden' name='ACTION' value='disable' />
394 <input type='image' name='submit' src='/images/stock_ok.png' alt='' />
399 <input type='hidden' name='ACTION' value='enable' />
400 <input type='image' name='submit' src='/images/stock_stop.png' alt='' />
411 <br />Klicken Sie auf die Symbole um das entsprechende iptables P2P-Blockmodul zu (de-)aktivieren.
417 & Header
:: openbox
( '100%' , 'center' , 'Policy' );
419 <form method='post' action=' $ENV {'SCRIPT_NAME'}'>
421 <tr><td width='10%' align='left'><b>Modus 0:</b><td width='90%' align='left' colspan='2'>In diesem Modus ist es allen Rechnern im Netzwerk uneingeschraenkt moeglich Verbindungen ins Internet aufzubauen.</td></tr>
422 <tr><td width='10%' align='left'><b>Modus 1:</b><td width='90%' align='left' colspan='2'>In diesem Modus werden nur Verbindungen nach den oben definierten Regeln zugelassen.</td></tr>
423 <tr><td width='10%' align='left'><b>Modus 2:</b><td width='90%' align='left' colspan='2'>In diesem Modus werden saemtliche Verbindungen erlaubt, bis auf die oben definierten Block-Regeln.</td></tr>
424 <tr><td colspan='3'><hr /></td></tr>
425 <tr><td width='10%' align='left'> <select name='POLICY' style="width: 85px"><option value='MODE0' $selected {'POLICY'}{'MODE0'}>Modus 0</option><option value='MODE1' $selected {'POLICY'}{'MODE1'}>Modus 1</option><option value='MODE2' $selected {'POLICY'}{'MODE2'}>Modus 2</option></select>
426 <td width='45%' align='left'><input type='submit' name='ACTION' value= $Lang ::tr{'save'} />
427 <td width='45%' align='left'>
430 if ( $outfwsettings { 'POLICY' } ne 'MODE0' ) {
432 Alle Regeln loeschen: <input type='submit' name='ACTION' value= $Lang ::tr{'reset'} />
443 & Header
:: closebigbox
();
444 & Header
:: closepage
();
446 ############################################################################################################################
447 ############################################################################################################################
451 & Header
:: openbox
( '100%' , 'center' , 'Rules hinzufuegen' );
452 if ( $outfwsettings { 'EDIT' } eq 'no' ) { $selected { 'ENABLED' } = 'checked' ; }
454 <form method='post' action=' $ENV {'SCRIPT_NAME'}'>
456 <tr><td width='20%' align='right'>Anmerkung: <img src='/blob.gif' />
457 <td width='30%' align='left'><input type='text' name='NAME' maxlength='30' value=' $outfwsettings {'NAME'}' />
458 <td width='20%' align='right'>Aktiviert:
459 <td width='30%' align='left'><input type='checkbox' name='ENABLED' $selected {'ENABLED'} />
460 <tr><td width='20%' align='right'>Protokoll:
461 <td width='30%' align='left'><select name='PROT'><option value='tcp' $selected {'PROT'}{'tcp'}>TCP</option><option value='tcp&udp' $selected {'PROT'}{'tcp&udp'}>TCP & UDP</option><option value='udp' $selected {'PROT'}{'udp'}>UDP</option></select>
462 <td width='20%' align='right'>Sicherheitspolitik:
463 <td width='30%' align='left'>
466 if ( $outfwsettings { 'POLICY' } eq 'MODE1' ){
467 print " \t\t\t ALLOW<input type='hidden' name='STATE' value='ALLOW' /> \n " ;
468 } elsif ( $outfwsettings { 'POLICY' } eq 'MODE2' ){
469 print " \t\t\t DENY<input type='hidden' name='STATE' value='DENY' /> \n " ;
472 <tr><td width='20%' align='right'>Quellnetz:
473 <td width='30%' align='left'><select name='SNET'>
474 <option value='all' $selected {'SNET'}{'ALL'}>alle</option>
475 <option value='ip' $selected {'SNET'}{'ip'}>Quell-IP/MAC benutzen</option>
476 <option value='green' $selected {'SNET'}{'green'}> $Lang ::tr{'green'}</option>
479 if (& Header
:: blue_used
()){
480 print " \t\t\t <option value='blue' $selected {'SNET'}{'blue'}> $Lang ::tr{'wireless'}</option> \n " ;
482 if (& Header
:: orange_used
()){
483 print " \t\t\t <option value='orange' $selected {'SNET'}{'orange'}> $Lang ::tr{'dmz'}</option> \n " ;
487 <td width='20%' align='right'>Quell-IP-Adresse: <img src='/blob.gif' />
488 <td width='30%' align='left'><input type='text' name='SIP' maxlength='15' value=' $outfwsettings {'SIP'}' />
489 <tr><td width='20%' align='right'>Logging:
490 <td width='30%' align='left'><select name='LOG'><option value=' $Lang ::tr{'active'}' $selected{'LOG'}{$Lang::tr{'active'}}> $Lang ::tr{'active'}</option><option value='$Lang::tr{'inactive'}' $selected{'LOG'}{$Lang::tr{'inactive'}}> $Lang ::tr{'inactive'}</option></select></td>
491 <td width='20%' align='right'>Quell-MAC-Adresse: <img src='/blob.gif' />
492 <td width='30%' align='left'><input type='text' name='SMAC' maxlength='23' value=' $outfwsettings {'SMAC'}' />
493 <tr><td width='20%' align='right'>Ziel-IP-Adresse: <img src='/blob.gif' />
494 <td width='30%' align='left'><input type='text' name='DIP' maxlength='15' value=' $outfwsettings {'DIP'}' />
495 <td width='20%' align='right'>Ziel-Port: <img src='/blob.gif' />
496 <td width='30%' align='left'><input type='text' name='DPORT' maxlength='11' value=' $outfwsettings {'DPORT'}' />
498 <tr><td width='40%' align='right' colspan='2'><img src='/blob.gif' /> $Lang ::tr{'this field may be blank'}
499 <td width='60%' align='left' colspan='2'><input type='submit' name='ACTION' value= $Lang ::tr{'add'} />
505 if ( $outfwsettings { 'POLICY' } eq 'MODE1' || $outfwsettings { 'POLICY' } eq 'MODE2' )
507 & Header
:: openbox
( '100%' , 'center' , 'Quick Add' );
509 open ( FILE
, "< /var/ipfire/outgoing/defaultservices" ) or die "Unable to read default services" ;
510 my @defservices = < FILE
>;
513 print "<table width='100%'><tr bgcolor=' $color {'color20'}'><td><b> $Lang ::tr{'service'}</b></td><td><b> $Lang ::tr{'description'}</b></td><td><b> $Lang ::tr{'port'}</b></td><td><b> $Lang ::tr{'protocol'}</b></td><td><b> $Lang ::tr{'source net'}</b></td><td><b> $Lang ::tr{'logging'}</b></td><td></td></tr>" ;
514 foreach my $serviceline ( @defservices )
516 my @service = split ( /,/ , $serviceline );
518 <tr><form method='post' action=' $ENV {'SCRIPT_NAME'}'>
519 <td> $service [0]<input type='hidden' name='NAME' value=' @service [0]' /></td>
521 <td><a href='http://isc.sans.org/port_details.php?port= $service [1]' target='top'> $service [1]</a><input type='hidden' name='DPORT' value=' @service [1]' /></td>
522 <td> $service [2]<input type='hidden' name='PROT' value=' @service [2]' /></td>
523 <td><select name='SNET'><option value='all' $selected {'SNET'}{'ALL'}> $Lang ::tr{'all'}</option><option value='green' $selected{'SNET'}{'green'}> $Lang ::tr{'green'}</option>
526 if (& Header
:: blue_used
()){
527 print "<option value='blue' $selected {'SNET'}{'blue'}> $Lang ::tr{'wireless'}</option>" ;
529 if (& Header
:: orange_used
()){
530 print "<option value='orange' $selected {'SNET'}{'orange'}> $Lang ::tr{'dmz'}</option>" ;
534 <td><select name='LOG'><option value=' $Lang ::tr{'active'}'> $Lang ::tr{'active'}</option><option value=' $Lang ::tr{'inactive'}' 'selected'> $Lang ::tr{'inactive'}</option></select></td><td>
535 <input type='hidden' name='ACTION' value= $Lang ::tr{'add'} />
536 <input type='image' alt=' $Lang ::tr{'add'}' src='/images/add.gif' />
537 <input type='hidden' name='ENABLED' value='on' />
540 if ( $outfwsettings { 'POLICY' } eq 'MODE1' ){ print "<input type='hidden' name='STATE' value='ALLOW' /></form></td></tr>" ;}
541 elsif ( $outfwsettings { 'POLICY' } eq 'MODE2' ){ print "<input type='hidden' name='STATE' value='DENY' /></form></td></tr>" ;}