1) Custom Hosts: now 17 chars can be entered into IP/MAC field
2) Forwardfw: Bugfix: When no alias is set and IPFIRE is selected as target, no target address is recognised
3) Forwardfw: Now source and Target addressfield (manual) are set to 17 chars maxlegth.
4) Converter: Bugfix: When starting converter from commandline, all hosts are entered into groups again.
$name3="Custom Network";
}
}
$name3="Custom Network";
}
}
+ if($name2 && !&check_grp($grp,$name2)){
my $grpkey = &General::findhasharraykey(\%groups);
$groups{$grpkey}[0] = $grp;
$groups{$grpkey}[1] = '';
my $grpkey = &General::findhasharraykey(\%groups);
$groups{$grpkey}[0] = $grp;
$groups{$grpkey}[1] = '';
$name2=$name.$mac;
$name3="Custom Host";
}
$name2=$name.$mac;
$name3="Custom Host";
}
+ if($name2 && !&check_grp($grp,$name2)){
my $grpkey = &General::findhasharraykey(\%groups);
$groups{$grpkey}[0] = $grp;
$groups{$grpkey}[1] = '';
my $grpkey = &General::findhasharraykey(\%groups);
$groups{$grpkey}[0] = $grp;
$groups{$grpkey}[1] = '';
my %aliases=();
my %optionsfw=();
my %aliases=();
my %optionsfw=();
my $color;
my $confignet = "${General::swroot}/fwhosts/customnetworks";
my $confighost = "${General::swroot}/fwhosts/customhosts";
my $color;
my $confignet = "${General::swroot}/fwhosts/customnetworks";
my $confighost = "${General::swroot}/fwhosts/customhosts";
&General::readhasharray("$configfwdfw", \%configfwdfw);
&General::readhasharray("$configinput", \%configinputfw);
&General::readhasharray("$configoutgoing", \%configoutgoingfw);
&General::readhasharray("$configfwdfw", \%configfwdfw);
&General::readhasharray("$configinput", \%configinputfw);
&General::readhasharray("$configoutgoing", \%configoutgoingfw);
$errormessage=&checksource;
if(!$errormessage){&checktarget;}
if(!$errormessage){&checkrule;}
$errormessage=&checksource;
if(!$errormessage){&checktarget;}
if(!$errormessage){&checkrule;}
&checkcounter($configfwdfw{$key}[5],$configfwdfw{$key}[6],,);
&checkcounter($configfwdfw{$key}[14],$configfwdfw{$key}[15],,);
}
&checkcounter($configfwdfw{$key}[5],$configfwdfw{$key}[6],,);
&checkcounter($configfwdfw{$key}[14],$configfwdfw{$key}[15],,);
}
- &General::readhasharray("$configinput", \%configinputfw);
- foreach my $key (sort keys %configinputfw){
- &checkcounter($configinputfw{$key}[3],$configinputfw{$key}[4],,);
- &checkcounter($configinputfw{$key}[5],$configinputfw{$key}[6],,);
- &checkcounter($configinputfw{$key}[14],$configinputfw{$key}[15],,);
- }
-
+ #&General::readhasharray("$configinput", \%configinputfw);
+ #foreach my $key (sort keys %configinputfw){
+ # &checkcounter($configinputfw{$key}[3],$configinputfw{$key}[4],,);
+ # &checkcounter($configinputfw{$key}[5],$configinputfw{$key}[6],,);
+ # &checkcounter($configinputfw{$key}[14],$configinputfw{$key}[15],,);
+ #}
+
system("rm ${General::swroot}/forward/config");
system("rm ${General::swroot}/forward/config");
- system("rm ${General::swroot}/forward/input");
+ #system("rm ${General::swroot}/forward/input");
&General::writehash("${General::swroot}/forward/settings", \%fwdfwsettings);
unless (-e "${General::swroot}/forward/config") { system("touch ${General::swroot}/forward/config"); }
&General::writehash("${General::swroot}/forward/settings", \%fwdfwsettings);
unless (-e "${General::swroot}/forward/config") { system("touch ${General::swroot}/forward/config"); }
- unless (-e "${General::swroot}/forward/input") { system("touch ${General::swroot}/forward/input"); }
+ #unless (-e "${General::swroot}/forward/input") { system("touch ${General::swroot}/forward/input"); }
my $MODE1=$fwdfwsettings{'POLICY1'};
%fwdfwsettings = ();
$fwdfwsettings{'POLICY'}='MODE2';
my $MODE1=$fwdfwsettings{'POLICY1'};
%fwdfwsettings = ();
$fwdfwsettings{'POLICY'}='MODE2';
$ip=&General::ip2dec($ip);
$ip=&General::dec2ip($ip);
$ip=&General::ip2dec($ip);
$ip=&General::dec2ip($ip);
- ##check if net or broadcast
- #my @tmp= split (/\./,$ip);
- #if ($tmp[3] eq "0" || ($tmp[3] eq "255"))
- #{
- #$errormessage=$Lang::tr{'fwhost err hostip'}."<br>";
- #}
$fwdfwsettings{'tgt_addr'}="$ip/$subnet";
$fwdfwsettings{'tgt_addr'}="$ip/$subnet";
if(!&General::validipandmask($fwdfwsettings{'tgt_addr'})){
$errormessage.=$Lang::tr{'fwdfw err tgt_addr'}."<br>";
}
if(!&General::validipandmask($fwdfwsettings{'tgt_addr'})){
$errormessage.=$Lang::tr{'fwdfw err tgt_addr'}."<br>";
}
foreach my $alias (sort keys %aliases)
{
if ($val eq $alias){
foreach my $alias (sort keys %aliases)
{
if ($val eq $alias){
- $tdcolor="style='border: 2px solid red;'";
+ $tdcolor="style='border: 1px solid $Header::colourred;'";
$tdcolor="style='border: 1px solid $Header::colourblue;'";
}
}elsif ($val eq 'Default IP'){
$tdcolor="style='border: 1px solid $Header::colourblue;'";
}
}elsif ($val eq 'Default IP'){
- $tdcolor="style='border: 1px solid red;'";
+ $tdcolor="style='border: 1px solid $Header::colourred;'";
#------SOURCE-------------------------------------------------------
print<<END;
<table width='100%' border='0'>
#------SOURCE-------------------------------------------------------
print<<END;
<table width='100%' border='0'>
- <tr><td width='1%'><input type='radio' name='grp1' value='src_addr' checked></td><td colspan='5'>$Lang::tr{'fwdfw sourceip'}<input type='TEXT' name='src_addr' value='$fwdfwsettings{'src_addr'}' ></td></tr>
+ <tr><td width='1%'><input type='radio' name='grp1' value='src_addr' checked></td><td colspan='5'>$Lang::tr{'fwdfw sourceip'}<input type='TEXT' name='src_addr' value='$fwdfwsettings{'src_addr'}' size='16' maxlength='17'></td></tr>
<tr><td colspan='7'><hr style='border:dotted #BFBFBF; border-width:1px 0 0 0 ; ' /></td></tr>
</table>
END
<tr><td colspan='7'><hr style='border:dotted #BFBFBF; border-width:1px 0 0 0 ; ' /></td></tr>
</table>
END
&Header::openbox('100%', 'left', $Lang::tr{'fwdfw target'});
print<<END;
<table width='100%' border='0'>
&Header::openbox('100%', 'left', $Lang::tr{'fwdfw target'});
print<<END;
<table width='100%' border='0'>
- <tr><td width='1%'><input type='radio' name='grp2' value='tgt_addr' checked></td><td width='57%' nowrap='nowrap'>$Lang::tr{'fwdfw targetip'}<input type='TEXT' name='tgt_addr' value='$fwdfwsettings{'tgt_addr'}' size='16'><td width='1%'><input type='radio' name='grp2' value='ipfire' $checked{'grp2'}{'ipfire'}></td><td><b>IPFire</b></td>
+ <tr><td width='1%'><input type='radio' name='grp2' value='tgt_addr' checked></td><td width='57%' nowrap='nowrap'>$Lang::tr{'fwdfw targetip'}<input type='TEXT' name='tgt_addr' value='$fwdfwsettings{'tgt_addr'}' size='16' maxlength='17'><td width='1%'><input type='radio' name='grp2' value='ipfire' $checked{'grp2'}{'ipfire'}></td><td><b>IPFire</b></td>
END
if (! -z "${General::swroot}/ethernet/aliases"){
print"<td align='right'><select name='ipfire' style='width:200px;'>";
END
if (! -z "${General::swroot}/ethernet/aliases"){
print"<td align='right'><select name='ipfire' style='width:200px;'>";
{
print "<option value='$alias' $selected{'ipfire'}{$alias}>$alias</option>";
}
{
print "<option value='$alias' $selected{'ipfire'}{$alias}>$alias</option>";
}
- print"<td style='width:200px;'>";
+ print"<td style='width:200px;'><input type='hidden' name ='ipfire' value='Default IP'>";
}
if ($_ eq $fwdfwsettings{'RULE_ACTION'})
{
}
if ($_ eq $fwdfwsettings{'RULE_ACTION'})
{
- print"<option selected>$Lang::tr{'fwdfw '.$_}</option>";
+ print"<option value='$_' selected>$Lang::tr{'fwdfw '.$_}</option>";
- print"<option>$Lang::tr{'fwdfw '.$_}</option>";
+ print"<option value='$_'>$Lang::tr{'fwdfw '.$_}</option>";
foreach my $key (sort keys %customgrp){
if($customgrp{$key}[2] eq $fwhostsettings{'orgname'}){
$customgrp{$key}[2]=$fwhostsettings{'HOSTNAME'};
foreach my $key (sort keys %customgrp){
if($customgrp{$key}[2] eq $fwhostsettings{'orgname'}){
$customgrp{$key}[2]=$fwhostsettings{'HOSTNAME'};
}
}
&General::writehasharray("$configgrp", \%customgrp);
}
}
&General::writehasharray("$configgrp", \%customgrp);
print<<END;
<table border='0' width='100%'><form method='post' style='display:inline'>
<tr><td>$Lang::tr{'name'}:</td><td><input type='TEXT' name='HOSTNAME' id='textbox1' value='$fwhostsettings{'HOSTNAME'}' $fwhostsettings{'BLK_HOST'} size='14'><script>document.getElementById('textbox1').focus()</script></td></tr>
print<<END;
<table border='0' width='100%'><form method='post' style='display:inline'>
<tr><td>$Lang::tr{'name'}:</td><td><input type='TEXT' name='HOSTNAME' id='textbox1' value='$fwhostsettings{'HOSTNAME'}' $fwhostsettings{'BLK_HOST'} size='14'><script>document.getElementById('textbox1').focus()</script></td></tr>
- <tr><td>IP/MAC:</td><td><input type='TEXT' name='IP' value='$fwhostsettings{'IP'}' $fwhostsettings{'BLK_IP'} size='14' maxlength='15'></td></tr>
+ <tr><td>IP/MAC:</td><td><input type='TEXT' name='IP' value='$fwhostsettings{'IP'}' $fwhostsettings{'BLK_IP'} size='14' maxlength='17'></td></tr>
<tr><td width='10%'>$Lang::tr{'remark'}:</td><td><input type='TEXT' name='HOSTREMARK' value='$fwhostsettings{'HOSTREMARK'}' style='width:98%;'></td></tr>
<tr><td colspan='5'><br><br><b>$Lang::tr{'fwhost attention'}</b><br>$Lang::tr{'fwhost macwarn'}</td></tr>
<tr><td colspan='5'><hr></hr></td></tr>
<tr><td width='10%'>$Lang::tr{'remark'}:</td><td><input type='TEXT' name='HOSTREMARK' value='$fwhostsettings{'HOSTREMARK'}' style='width:98%;'></td></tr>
<tr><td colspan='5'><br><br><b>$Lang::tr{'fwhost attention'}</b><br>$Lang::tr{'fwhost macwarn'}</td></tr>
<tr><td colspan='5'><hr></hr></td></tr>