sub get_srv_prot
{
my $val=shift;
- foreach my $key (sort keys %customservice){
+ foreach my $key (sort {$a <=> $b} keys %customservice){
if($customservice{$key}[0] eq $val){
if ($customservice{$key}[0] eq $val){
return $customservice{$key}[2];
my $tcp;
my $udp;
my $icmp;
- foreach my $key (sort keys %customservicegrp){
+ foreach my $key (sort {$a <=> $b} keys %customservicegrp){
if($customservicegrp{$key}[0] eq $val){
if (&get_srv_prot($customservicegrp{$key}[2]) eq 'TCP'){
$tcp=1;
my $val=shift;
my $field=shift;
my $prot=shift;
- foreach my $key (sort keys %customservice){
+ foreach my $key (sort {$a <=> $b} keys %customservice){
if($customservice{$key}[0] eq $val){
if($customservice{$key}[2] eq $prot){
return $customservice{$key}[$field];
my $back;
my $value;
my @ips=();
- foreach my $key (sort keys %customservicegrp){
+ foreach my $key (sort {$a <=> $b} keys %customservicegrp){
if($customservicegrp{$key}[0] eq $val){
if ($prot ne 'ICMP'){
$value=&get_srv_port($customservicegrp{$key}[2],1,$prot);
{
my $val=shift;
my $field=shift;
- foreach my $key (sort keys %ipsecconf){
+ foreach my $key (sort {$a <=> $b} keys %ipsecconf){
if($ipsecconf{$key}[1] eq $val){
return $ipsecconf{$key}[$field];
}
{
my $val=shift;
my $field=shift;
- foreach my $key (sort keys %ipsecconf){
+ foreach my $key (sort {$a <=> $b} keys %ipsecconf){
if($ipsecconf{$key}[1] eq $val){
return $ipsecconf{$key}[$field];
}
{
my $val=shift;
my $field=shift;
- foreach my $key (sort keys %ccdhost){
+ foreach my $key (sort {$a <=> $b} keys %ccdhost){
if($ccdhost{$key}[1] eq $val){
return $ccdhost{$key}[$field];
}
{
my $val=shift;
my $field=shift;
- foreach my $key (sort keys %ccdhost){
+ foreach my $key (sort {$a <=> $b} keys %ccdhost){
if($ccdhost{$key}[1] eq $val){
return $ccdhost{$key}[$field];
}
my $val=shift;
my $field=shift;
- foreach my $key (sort keys %ccdnet){
+ foreach my $key (sort {$a <=> $b} keys %ccdnet){
if($ccdnet{$key}[0] eq $val){
return $ccdnet{$key}[$field];
}
{
my $val=shift;
my $src=shift;
- foreach my $key (sort keys %customgrp){
+ foreach my $key (sort {$a <=> $b} keys %customgrp){
if ($customgrp{$key}[0] eq $val){
&get_address($customgrp{$key}[3],$src);
}
sub get_std_net_ip
{
my $val=shift;
+ my $con=shift;
if ($val eq 'ALL'){
return "0.0.0.0/0.0.0.0";
}elsif($val eq 'GREEN'){
return "$netsettings{'ORANGE_NETADDRESS'}/$netsettings{'ORANGE_NETMASK'}";
}elsif($val eq 'BLUE'){
return "$netsettings{'BLUE_NETADDRESS'}/$netsettings{'BLUE_NETMASK'}";
+ }elsif($val eq 'RED'){
+ return "0.0.0.0/0 -o $con";
}elsif($val =~ /OpenVPN/i){
return "$ovpnsettings{'DOVPN_SUBNET'}";
}elsif($val =~ /IPsec/i){
return "$ipsecsettings{'RW_NET'}";
+ }elsif($val eq 'IPFire'){
+ return ;
}
}
sub get_net_ip
{
my $val=shift;
- foreach my $key (sort keys %customnetwork){
+ foreach my $key (sort {$a <=> $b} keys %customnetwork){
if($customnetwork{$key}[0] eq $val){
return "$customnetwork{$key}[1]/$customnetwork{$key}[2]";
}
{
my $val=shift;
my $src=shift;
- foreach my $key (sort keys %customhost){
+ foreach my $key (sort {$a <=> $b} keys %customhost){
if($customhost{$key}[0] eq $val){
if ($customhost{$key}[1] eq 'mac' && $src eq 'src'){
return "-m mac --mac-source $customhost{$key}[2]";