$Lang::tr{'fwdfw sourceip'}
- $Lang::tr{'fwhost stdnet'}
-END
- foreach my $network (sort keys %defaultNetworks)
- {
- next if($defaultNetworks{$network}{'LOCATION'} eq "IPCOP");
- next if($defaultNetworks{$network}{'NAME'} eq "RED");
- print "$network ";
- }
- print< $Lang::tr{'fwhost ccdnet'}
-END
- &fillselect(\%ccdnet,$fwdfwsettings{$fwdfwsettings{'grp1'}});
- print<
- $Lang::tr{'fwhost cust net'}
-END
- &fillselect(\%customnetwork,$fwdfwsettings{$fwdfwsettings{'grp1'}});
- print< $Lang::tr{'fwhost ccdhost'}
-END
- foreach my $key (sort { uc($ccdhost{$a}[0]) cmp uc($ccdhost{$b}[0]) } keys %ccdhost)
- {
- if ($ccdhost{$key}[33] ne ''){
-
- print "$ccdhost{$key}[1] ";
- }
- }
- print<
- $Lang::tr{'fwhost cust addr'}
-END
- &fillselect(\%customhost,$fwdfwsettings{$fwdfwsettings{'grp1'}});
- print< $Lang::tr{'fwhost ovpn_n2n'}
-END
- foreach my $key (sort { uc($ccdhost{$a}[0]) cmp uc($ccdhost{$b}[0]) } keys %ccdhost) {
- if($ccdhost{$key}[3] eq 'net'){
- print"$ccdhost{$key}[1] ";
- }
- }
- print<
-
- $Lang::tr{'fwhost cust grp'}
-END
- foreach my $key (sort { uc($customgrp{$a}[0]) cmp uc($customgrp{$b}[0]) } keys %customgrp) {
- if($helper ne $customgrp{$key}[0]){
- print"$customgrp{$key}[0] ";
- }
- $helper=$customgrp{$key}[0];
- }
- print<
- $Lang::tr{'fwhost ipsec net'}
-END
- foreach my $key (sort { uc($ipsecconf{$a}[1]) cmp uc($ipsecconf{$b}[1]) } keys %ipsecconf) {
- if ($ipsecconf{$key}[3] eq 'net'){
- print "$ipsecconf{$key}[1] ";
- }
- }
- #sourceport
- print<
+
END
+ &gen_dd_block('src','grp1');
-# $Lang::tr{'fwhost ipsec host'}
-#END
-# foreach my $key (sort { uc($ipsecconf{$a}[1]) cmp uc($ipsecconf{$b}[1]) } keys %ipsecconf) {
-# if ($ipsecconf{$key}[3] eq 'host'){
-# print "$ipsecconf{$key}[1] ";
-# }
-# }
print<
-END
- &Header::closebox();
-
- #---TARGET------------------------------------------------------
- &Header::openbox('100%', 'left', $Lang::tr{'fwdfw target'});
- print<
- $Lang::tr{'fwdfw targetip'} IPFire ($Lang::tr{'external access'})
-END
- print "Default IP ";
-
- foreach my $alias (sort keys %aliases)
- {
- print "$alias ";
- }
-
- print<
-
- $Lang::tr{'fwhost stdnet'}
-END
- foreach my $network (sort keys %defaultNetworks)
- {
- print "$network ";
- }
- print< $Lang::tr{'fwhost ccdnet'}
-END
- &fillselect(\%ccdnet,$fwdfwsettings{$fwdfwsettings{'grp2'}});
- print<
- $Lang::tr{'fwhost cust net'}
-END
- &fillselect(\%customnetwork,$fwdfwsettings{$fwdfwsettings{'grp2'}});
- print< $Lang::tr{'fwhost ccdhost'}
-END
- foreach my $key (sort { uc($ccdhost{$a}[0]) cmp uc($ccdhost{$b}[0]) } keys %ccdhost)
- {
- if ($ccdhost{$key}[33] ne ''){
- print "$ccdhost{$key}[1] ";
- }
- }
- print<
- $Lang::tr{'fwhost cust addr'}
-END
- &fillselect(\%customhost,$fwdfwsettings{$fwdfwsettings{'grp2'}});
- print< $Lang::tr{'fwhost ovpn_n2n'}
-END
- foreach my $key (sort { uc($ccdhost{$a}[0]) cmp uc($ccdhost{$b}[0]) } keys %ccdhost) {
- if($ccdhost{$key}[3] eq 'net'){
- print "$ccdhost{$key}[1] ";
+ }else{
+ print"$_ ";
}
}
+ $fwdfwsettings{'SRC_PORT'}=~ s/\|/,/g;
print<
- $Lang::tr{'fwhost cust grp'}
+
+ $Lang::tr{'fwhost icmptype'}
END
- $helper='';
- foreach my $key (sort { uc($customgrp{$a}[0]) cmp uc($customgrp{$b}[0]) } keys %customgrp) {
- if($helper ne $customgrp{$key}[0]){
- print"$customgrp{$key}[0] ";
+ &General::readhasharray("${General::swroot}/fwhosts/icmp-types", \%icmptypes);
+ print"All ICMP-Types ";
+ foreach my $key (sort { uc($icmptypes{$a}[0]) cmp uc($icmptypes{$b}[0]) } keys %icmptypes){
+ if($fwdfwsettings{'ICMP_TYPES'} eq "$icmptypes{$key}[0]"){
+ print"$icmptypes{$key}[0] ($icmptypes{$key}[1]) ";
+ }else{
+ print"$icmptypes{$key}[0] ($icmptypes{$key}[1]) ";
}
- $helper=$customgrp{$key}[0];
}
print<
- $Lang::tr{'fwhost ipsec net'}
+
END
- foreach my $key (sort { uc($ipsecconf{$a}[1]) cmp uc($ipsecconf{$b}[1]) } keys %ipsecconf) {
- if ($ipsecconf{$key}[3] eq 'net'){
- print"$ipsecconf{$key}[1] ";
- }
+ &Header::closebox();
+
+ #---TARGET------------------------------------------------------
+ &Header::openbox('100%', 'left', $Lang::tr{'fwdfw target'});
+ print<
+ $Lang::tr{'fwdfw targetip'} IPFire ($Lang::tr{'external access'})
+END
+ print "Default IP ";
+
+ foreach my $alias (sort keys %aliases)
+ {
+ print "$alias ";
}
print<
+
+
END
-# $Lang::tr{'fwhost ipsec host'}
-#END
-# foreach my $key (sort { uc($ipsecconf{$a}[1]) cmp uc($ipsecconf{$b}[1]) } keys %ipsecconf) {
-# if ($ipsecconf{$key}[3] eq 'host'){
-# print"$ipsecconf{$key}[1] ";
-# }
-# }
+ &gen_dd_block('tgt','grp2');
print<
$Lang::tr{'fwhost attention'}:
$Lang::tr{'fwhost macwarn'}
-
+
END
+ &Header::closebox;
#---Activate/logging/remark-------------------------------------
&Header::openbox('100%', 'left', $Lang::tr{'fwdfw additional'});
print<
+
END
&Header::closebox();
#---ADD TIMEFRAME-----------------------------------------------
@@ -1436,9 +1698,8 @@ END
}
print<
-
+
END
- &Header::closebox();
#---ACTION------------------------------------------------------
if($fwdfwsettings{'updatefwrule'} ne 'on'){
print<
+
END
}
&Header::closebox();
}
+sub pos_up
+{
+ my %uphash=();
+ my %tmp=();
+ &General::readhasharray($fwdfwsettings{'config'}, \%uphash);
+ foreach my $key (sort keys %uphash){
+ if ($key eq $fwdfwsettings{'key'}) {
+ my $last = $key -1;
+ if (exists $uphash{$last}){
+ #save rule last
+ foreach my $y (0 .. $#{$uphash{$last}}) {
+ $tmp{0}[$y] = $uphash{$last}[$y];
+ }
+ #copy active rule to last
+ foreach my $i (0 .. $#{$uphash{$last}}) {
+ $uphash{$last}[$i] = $uphash{$key}[$i];
+ }
+ #copy saved rule to actual position
+ foreach my $x (0 .. $#{$tmp{0}}) {
+ $uphash{$key}[$x] = $tmp{0}[$x];
+ }
+ }
+ }
+ }
+ &General::writehasharray($fwdfwsettings{'config'}, \%uphash);
+ &rules;
+}
+sub pos_down
+{
+ my %downhash=();
+ my %tmp=();
+ &General::readhasharray($fwdfwsettings{'config'}, \%downhash);
+ foreach my $key (sort keys %downhash){
+ if ($key eq $fwdfwsettings{'key'}) {
+ my $next = $key + 1;
+ if (exists $downhash{$next}){
+ #save rule next
+ foreach my $y (0 .. $#{$downhash{$next}}) {
+ $tmp{0}[$y] = $downhash{$next}[$y];
+ }
+ #copy active rule to next
+ foreach my $i (0 .. $#{$downhash{$next}}) {
+ $downhash{$next}[$i] = $downhash{$key}[$i];
+ }
+ #copy saved rule to actual position
+ foreach my $x (0 .. $#{$tmp{0}}) {
+ $downhash{$key}[$x] = $tmp{0}[$x];
+ }
+ }
+ }
+ }
+ &General::writehasharray($fwdfwsettings{'config'}, \%downhash);
+ &rules;
+}
+sub rules
+{
+ if (!-f "${General::swroot}/forward/reread"){
+ system("touch ${General::swroot}/forward/reread");
+ system("touch ${General::swroot}/fwhosts/reread");
+ }
+}
+sub reread_rules
+{
+ system("/usr/local/bin/forwardfwctrl");
+ if ( -f "${General::swroot}/forward/reread"){
+ system("rm ${General::swroot}/forward/reread");
+ system("rm ${General::swroot}/fwhosts/reread");
+ }
+}
sub saverule
{
my $hash=shift;
my $config=shift;
&General::readhasharray("$config", $hash);
if (!$errormessage){
+ #check if we change a DMZ to an outgoing
+ if( ($fwdfwsettings{'oldgrp1b'} eq 'ORANGE' || $fwdfwsettings{'oldorange'} eq 'on') && $fwdfwsettings{$fwdfwsettings{'grp1'}} eq 'IPFire' && $fwdfwsettings{'updatefwrule'} eq 'on'){
+ &changerule($configdmz);
+ #print"1";
+ }
+ #check if we change a DMZ to an external access
+ elsif( $fwdfwsettings{'oldgrp1b'} eq 'ORANGE' && $fwdfwsettings{$fwdfwsettings{'grp1'}} ne 'ORANGE' && $fwdfwsettings{'grp2'} eq 'ipfire' && $fwdfwsettings{'updatefwrule'} eq 'on'){
+ &changerule($configdmz);
+ #print"2";
+ }
+ #check if we change an external access rule to a outgoing
+ elsif( $fwdfwsettings{$fwdfwsettings{'grp1'}} eq 'IPFire' && $fwdfwsettings{'oldgrp1b'} ne 'IPFire' && $fwdfwsettings{'grp2'} ne 'ipfire' && $fwdfwsettings{'oldgrp2a'} eq 'ipfire' && $fwdfwsettings{'updatefwrule'} eq 'on'){
+ &changerule($configinput);
+ #print"3";
+ }
+ #check if we change an external access rule to a DMZ
+ elsif( $fwdfwsettings{$fwdfwsettings{'grp1'}} eq 'ORANGE' && $fwdfwsettings{'grp2'} ne 'ipfire' && $fwdfwsettings{'oldgrp2a'} eq 'ipfire' && $fwdfwsettings{'updatefwrule'} eq 'on'){
+ &changerule($configinput);
+ #print"4";
+ }
+ #check if we change an outgoing rule to a external access
+ if( $fwdfwsettings{$fwdfwsettings{'grp1'}} ne 'IPFire' && $fwdfwsettings{'oldgrp1b'} eq 'IPFire' && $fwdfwsettings{'grp2'} eq 'ipfire' && $fwdfwsettings{'oldgrp2a'} ne 'ipfire' && $fwdfwsettings{'updatefwrule'} eq 'on'){
+ &changerule($configoutgoing);
+ #print"5";
+ }
+ #check if we change an outgoing rule to a DMZ
+ if( ($fwdfwsettings{$fwdfwsettings{'grp1'}} eq 'ORANGE' || $checkorange eq 'on') && $fwdfwsettings{'oldgrp1b'} eq 'IPFire' && $fwdfwsettings{'updatefwrule'} eq 'on'){
+ &changerule($configoutgoing);
+ #print"6";
+ }
+ #check if we change an forward rule to an external access
+ elsif( $fwdfwsettings{'grp2'} eq 'ipfire' && $fwdfwsettings{'oldgrp2a'} ne 'ipfire' && $fwdfwsettings{'updatefwrule'} eq 'on'){
+ &changerule($configfwdfw);
+ #print"7";
+ }
+ #check if we change an forward rule to an DMZ
+ if( ($fwdfwsettings{$fwdfwsettings{'grp1'}} eq 'ORANGE' || $checkorange eq 'on') && ($fwdfwsettings{'oldgrp1b'} ne 'ORANGE' && $fwdfwsettings{'oldorange'} ne 'on') && $fwdfwsettings{'updatefwrule'} eq 'on'){
+ &changerule($configfwdfw);
+ #print"8";
+ }
+ #check if we change an forward rule to an outgoing
+ elsif( $fwdfwsettings{$fwdfwsettings{'grp1'}} eq 'IPFire' && $fwdfwsettings{'oldgrp1b'} ne 'IPFire' && $fwdfwsettings{'updatefwrule'} eq 'on'){
+ &changerule($configfwdfw);
+ #print"9";
+ }
+ #check if we change a DMZ to a forward
+ elsif( ($fwdfwsettings{'oldgrp1b'} eq 'ORANGE' || $fwdfwsettings{'oldorange'} eq 'on') && ($fwdfwsettings{$fwdfwsettings{'grp1'}} ne 'ORANGE' && $checkorange ne 'on') && $fwdfwsettings{'updatefwrule'} eq 'on'){
+ &changerule($configdmz);
+ #print"10";
+ }
+ #check if we change an external access rule to a forward
+ elsif( $fwdfwsettings{'grp2'} ne 'ipfire' && $fwdfwsettings{'oldgrp2a'} eq 'ipfire' && $fwdfwsettings{'updatefwrule'} eq 'on'){
+ &changerule($configinput);
+ #print"11";
+ }
+ #check if we change an outgoing rule to a forward
+ elsif( $fwdfwsettings{$fwdfwsettings{'grp1'}} ne 'IPFire' && $fwdfwsettings{'oldgrp1b'} eq 'IPFire' && $fwdfwsettings{'grp2'} ne 'ipfire' && $fwdfwsettings{'updatefwrule'} eq 'on'){
+ &changerule($configoutgoing);
+ #print"12";
+ }
if ($fwdfwsettings{'updatefwrule'} ne 'on'){
my $key = &General::findhasharraykey ($hash);
$$hash{$key}[0] = $fwdfwsettings{'RULE_ACTION'};
@@ -1542,7 +1933,7 @@ sub saverule
}
}
&General::writehasharray("$config", $hash);
- if($fwdfwsettings{'oldrulenumber'} gt $fwdfwsettings{'rulepos'}){
+ if($fwdfwsettings{'oldrulenumber'} > $fwdfwsettings{'rulepos'}){
my %tmp=();
my $val=$fwdfwsettings{'oldrulenumber'}-$fwdfwsettings{'rulepos'};
for (my $z=0;$z<$val;$z++){
@@ -1569,7 +1960,7 @@ sub saverule
}
&General::writehasharray("$config", $hash);
&rules;
- }elsif($fwdfwsettings{'rulepos'} gt $fwdfwsettings{'oldrulenumber'}){
+ }elsif($fwdfwsettings{'rulepos'} > $fwdfwsettings{'oldrulenumber'}){
my %tmp=();
my $val=$fwdfwsettings{'rulepos'}-$fwdfwsettings{'oldrulenumber'};
for (my $z=0;$z<$val;$z++){
@@ -1599,35 +1990,6 @@ sub saverule
}
}
}
-sub error
-{
- if ($errormessage) {
- &Header::openbox('100%', 'left', $Lang::tr{'error messages'});
- print "$errormessage\n";
- print " \n";
- &Header::closebox();
- print" ";
- }
-}
-sub hint
-{
- if ($hint) {
- &Header::openbox('100%', 'left', $Lang::tr{'fwhost hint'});
- print "$hint\n";
- print " \n";
- &Header::closebox();
- print" ";
- }
-}
-sub get_name
-{
- my $val=shift;
- &General::setup_default_networks(\%defaultNetworks);
- foreach my $network (sort keys %defaultNetworks)
- {
- return "$network" if ($val eq $defaultNetworks{$network}{'NAME'});
- }
-}
sub validremark
{
# Checks a hostname against RFC1035
@@ -1638,87 +2000,23 @@ sub validremark
if (length ($remark) < 1 || length ($remark) > 255) {
return 0;}
# Only valid characters are a-z, A-Z, 0-9 and -
- if ($remark !~ /^[a-zäöüA-ZÃÃÃ0-9-.:_\/\s]*$/) {
+ if ($remark !~ /^[a-zäöüA-ZÃÃÃ0-9-.:;\|_()\/\s]*$/) {
return 0;}
# First character can only be a letter or a digit
if (substr ($remark, 0, 1) !~ /^[a-zäöüA-ZÃÃÃ0-9]*$/) {
return 0;}
# Last character can only be a letter or a digit
- if (substr ($remark, -1, 1) !~ /^[a-zöäüA-ZÃÃÃ0-9.]*$/) {
+ if (substr ($remark, -1, 1) !~ /^[a-zöäüA-ZÃÃÃ0-9.:;_)]*$/) {
return 0;}
return 1;
}
-sub getsrcport
-{
- my %hash=%{(shift)};
- my $key=shift;
- if($hash{$key}[7] eq 'ON' && $hash{$key}[8] ne '' && $hash{$key}[10]){
- $hash{$key}[10]=~ s/\|/,/g;
- print": $hash{$key}[10]";
- }elsif($hash{$key}[7] eq 'ON' && $hash{$key}[8] eq 'ICMP'){
- print": $hash{$key}[9] ";
- }
-}
-sub gettgtport
-{
- my %hash=%{(shift)};
- my $key=shift;
- my $service;
- my $prot;
- if($hash{$key}[11] eq 'ON' && $hash{$key}[12] ne 'ICMP'){
- if($hash{$key}[14] eq 'cust_srv'){
- &General::readhasharray("$configsrv", \%customservice);
- foreach my $i (sort keys %customservice){
- if($customservice{$i}[0] eq $hash{$key}[15]){
- $service = $customservice{$i}[0];
- }
- }
- }elsif($hash{$key}[14] eq 'cust_srvgrp'){
- $service=$hash{$key}[15];
- }elsif($hash{$key}[14] eq 'TGT_PORT'){
- $hash{$key}[15]=~ s/\|/,/g;
- $service=$hash{$key}[15];
- }
- if($service){
- print": $service";
- }
- }elsif($hash{$key}[11] eq 'ON' && $hash{$key}[12] eq 'ICMP'){
- print": $hash{$key}[13]";
- }
-}
-sub get_serviceports
-{
- my $type=shift;
- my $name=shift;
- &General::readhasharray("$configsrv", \%customservice);
- &General::readhasharray("$configsrvgrp", \%customservicegrp);
- my $protocols;
- my $tcp;
- my $udp;
- if($type eq 'service'){
- foreach my $key (sort { uc($customservice{$a}[0]) cmp uc($customservice{$b}[0]) } keys %customservice){
- if ($customservice{$key}[0] eq $name){
- $protocols=$customservice{$key}[2];
- }
- }
-
- }elsif($type eq 'group'){
- foreach my $key (sort { uc($customservicegrp{$a}[0]) cmp uc($customservicegrp{$b}[0]) } keys %customservicegrp){
- if ($customservicegrp{$key}[0] eq $name){
- if($customservicegrp{$key}[4] eq 'TCP'){$tcp='TCP';}else{$udp='UDP';}
- }
- }
- }
- if($tcp){$protocols.="TCP";}
- if($udp){$protocols.=",UDP";}
- return $protocols;
-}
sub viewtablerule
{
-
- &viewtablenew(\%configfwdfw,$configfwdfw,$Lang::tr{'fwdfw rules'},"Forward" );
- &viewtablenew(\%configfwdfw,$configfwdfw,'',"DMZ" );
+ &General::readhash("/var/ipfire/ethernet/settings", \%netsettings);
+ &viewtablenew(\%configdmzfw,$configdmz,$Lang::tr{'fwdfw rules'},"DMZ" );
+ &viewtablenew(\%configfwdfw,$configfwdfw,"","Forward" );
&viewtablenew(\%configinputfw,$configinput,"",$Lang::tr{'external access'} );
+ &viewtablenew(\%configoutgoingfw,$configoutgoing,"","Outgoing" );
}
sub viewtablenew
{
@@ -1727,16 +2025,10 @@ sub viewtablenew
my $title=shift;
my $title1=shift;
my $go='';
+ &General::get_aliases(\%aliases);
+ &General::readhasharray("$confighost", \%customhost);
&General::readhasharray("$config", $hash);
- #check if there are DMZ entries
- if ($title1 eq 'DMZ'){
- foreach my $key (keys %$hash){
- if ($$hash{$key}[4] eq 'ORANGE' || $$hash{$key}[6] eq 'ORANGE'){$go='on';}
- }
- }elsif( ! -z "$config" ){
- $go='on';
- }
- if($go ne ''){
+ if( ! -z $config){
&Header::openbox('100%', 'left',$title);
my $count=0;
my ($gif,$log);
@@ -1746,12 +2038,10 @@ sub viewtablenew
my @tmpsrc=();
my $coloryellow='';
print"$title1 ";
- print"";
- print"# $Lang::tr{'fwdfw source'} Log $Lang::tr{'fwdfw target'} $Lang::tr{'protocol'} $Lang::tr{'remark'} $Lang::tr{'fwdfw action'} ";
+ print"";
+ print"# $Lang::tr{'fwdfw source'} Log $Lang::tr{'fwdfw target'} $Lang::tr{'protocol'} $Lang::tr{'fwdfw time'} $Lang::tr{'fwdfw action'} ";
foreach my $key (sort {$a <=> $b} keys %$hash){
- #check if we have a FORWARDFW OR DMZ RULE
- if ($title1 eq 'DMZ' && ($$hash{$key}[4] ne 'ORANGE' && $$hash{$key}[6] ne 'ORANGE')){next;}
- if ($title1 eq 'Forward' && ($$hash{$key}[4] eq 'ORANGE' || $$hash{$key}[6] eq 'ORANGE')){next;}
+ $tdcolor='';
@tmpsrc=();
#check if vpn hosts/nets have been deleted
if($$hash{$key}[3] =~ /ipsec/i || $$hash{$key}[3] =~ /ovpn/i){
@@ -1786,8 +2076,6 @@ sub viewtablenew
$$hash{$key}[2]='';
}
}
- $$hash{$key}[3]='';
- $$hash{$key}[5]='';
}
$$hash{'ACTIVE'}=$$hash{$key}[2];
$count++;
@@ -1796,14 +2084,15 @@ sub viewtablenew
$coloryellow='';
}elsif($coloryellow eq ''){
if ($count % 2){
- print"";
+ $color="$color{'color22'}";
}
else{
- print" ";
+ $color="$color{'color20'}";
}
}
+ print" ";
print<$key
+ $key
END
if ($$hash{$key}[0] eq 'ACCEPT'){
$ruletype='A';
@@ -1818,13 +2107,15 @@ END
$tooltip='REJECT';
$rulecolor=$color{'color16'};
}
- print"$ruletype ";
- print"";
+ print" $ruletype ";
+ &getcolor($$hash{$key}[3],$$hash{$key}[4],\%customhost);
+ print"";
if ($$hash{$key}[3] eq 'std_net_src'){
print &get_name($$hash{$key}[4]);
}else{
print $$hash{$key}[4];
}
+ $tdcolor='';
&getsrcport(\%$hash,$key);
if ($$hash{$key}[17] eq 'ON'){
$log="/images/on.gif";
@@ -1834,40 +2125,56 @@ END
print<
END
+ &getcolor($$hash{$key}[5],$$hash{$key}[6],\%customhost);
print<
+
END
if ($$hash{$key}[5] eq 'std_net_tgt'){
print &get_name($$hash{$key}[6]);
}else{
print $$hash{$key}[6];
}
+ $tdcolor='';
&gettgtport(\%$hash,$key);
- ################################################################################
print" ";
#Get Protocol
my $prot;
if ($$hash{$key}[12]){ #target prot if manual
- $prot=$$hash{$key}[12];
+ push (@protocols,$$hash{$key}[12]);
}elsif($$hash{$key}[8]){ #source prot if manual
- $prot=$$hash{$key}[8];
+ push (@protocols,$$hash{$key}[8]);
}elsif($$hash{$key}[14] eq 'cust_srv'){
- $prot=&get_serviceports("service",$$hash{$key}[15]);
+ &get_serviceports("service",$$hash{$key}[15]);
}elsif($$hash{$key}[14] eq 'cust_srvgrp'){
- $prot=&get_serviceports("group",$$hash{$key}[15]);
+ &get_serviceports("group",$$hash{$key}[15]);
}else{
- $prot=$Lang::tr{'all'};
+ push (@protocols,$Lang::tr{'all'});
}
- print"$prot ";
-
- print"$$hash{$key}[16] ";
-
+ my $protz=join(",",@protocols);
+ print"$protz ";
+ @protocols=();
+ if ($$hash{$key}[18] eq 'ON'){
+ my @days=();
+ if($$hash{$key}[19] ne ''){push (@days,$Lang::tr{'fwdfw wd_mon'});}
+ if($$hash{$key}[20] ne ''){push (@days,$Lang::tr{'fwdfw wd_tue'});}
+ if($$hash{$key}[21] ne ''){push (@days,$Lang::tr{'fwdfw wd_wed'});}
+ if($$hash{$key}[22] ne ''){push (@days,$Lang::tr{'fwdfw wd_thu'});}
+ if($$hash{$key}[23] ne ''){push (@days,$Lang::tr{'fwdfw wd_fri'});}
+ if($$hash{$key}[24] ne ''){push (@days,$Lang::tr{'fwdfw wd_sat'});}
+ if($$hash{$key}[25] ne ''){push (@days,$Lang::tr{'fwdfw wd_sun'});}
+ my $weekdays=join(",",@days);
+ if (@days){
+ print"$weekdays   $$hash{$key}[26] - $$hash{$key}[27] ";
+ }
+ }else{
+ print"24/7 ";
+ }
if($$hash{$key}[2] eq 'ON'){
$gif="/images/on.gif"
@@ -1876,25 +2183,25 @@ END
}
print<
-
+
END
}else{
- print" ";
+ print" ";
}
- #if timeframe set, print new line in table
- if ($$hash{$key}[18] eq 'ON'){
- my @days=();
- if($$hash{$key}[19] ne ''){push (@days,$Lang::tr{'fwdfw wd_mon'});}
- if($$hash{$key}[20] ne ''){push (@days,$Lang::tr{'fwdfw wd_tue'});}
- if($$hash{$key}[21] ne ''){push (@days,$Lang::tr{'fwdfw wd_wed'});}
- if($$hash{$key}[22] ne ''){push (@days,$Lang::tr{'fwdfw wd_thu'});}
- if($$hash{$key}[23] ne ''){push (@days,$Lang::tr{'fwdfw wd_fri'});}
- if($$hash{$key}[24] ne ''){push (@days,$Lang::tr{'fwdfw wd_sat'});}
- if($$hash{$key}[25] ne ''){push (@days,$Lang::tr{'fwdfw wd_sun'});}
- my $weekdays=join(",",@days);
- if (@days){
- print"$Lang::tr{'fwdfw time'} ";
- print"$weekdays";
- print "  $Lang::tr{'fwdfw from'} $$hash{$key}[26]   $Lang::tr{'fwdfw till'} $$hash{$key}[27] ";
- }
+ #REMARK
+ if ($optionsfw{'SHOWREMARK'} eq 'on'){
+ print"";
+ print"    $$hash{$key}[16] ";
}
+ print" ";
}
print"
";
&Header::closebox();
- }
-}
-sub p2pblock
-{
- my $gif;
- open( FILE, "< $p2pfile" ) or die "Unable to read $p2pfile";
- @p2ps = ;
- close FILE;
- &Header::openbox('100%', 'center', 'P2P-Block');
- print <
- $Lang::tr{'protocol'} $Lang::tr{'status'}
-END
- foreach my $p2pentry (sort @p2ps)
- {
- my @p2pline = split( /\;/, $p2pentry );
- if($p2pline[2] eq 'on'){
- $gif="/images/on.gif"
- }else{
- $gif="/images/off.gif"
- }
- print <
-
- $p2pline[0]:
-END
- }
- print"$Lang::tr{'outgoing firewall p2p allow'} ";
- print"$Lang::tr{'outgoing firewall p2p deny'}
";
- &Header::closebox();
-}
-sub fillselect
-{
- my %hash=%{(shift)};
- my $val=shift;
- my $key;
- foreach my $key (sort { uc($hash{$a}[0]) cmp uc($hash{$b}[0]) } keys %hash){
- if($hash{$key}[0] eq $val){
- print"$hash{$key}[0] ";
- }else{
- print"$hash{$key}[0] ";
+ print " ";
+ print " ";
+ }else{
+ if ($optionsfw{'SHOWTABLES'} eq 'on'){
+ print "$title1 ";
+ print"$Lang::tr{'fwhost empty'}
";
}
}
}
-sub rules
-{
- if (!-f "${General::swroot}/forward/reread"){
- system("touch ${General::swroot}/forward/reread");
- }
-}
-sub reread_rules
-{
- system("/usr/local/bin/forwardfwctrl");
- system("rm ${General::swroot}/forward/reread");
-}
+
+
&Header::closebigbox();
&Header::closepage();