mirror of
https://github.com/webmin/webmin.git
synced 2025-08-01 15:36:00 +00:00
IPset code cleanup and better rule description
This commit is contained in:
@ -281,6 +281,9 @@ foreach $d ('p', 's', 'd', 'i', 'o', 'f', 'dport',
|
|||||||
if ($d eq 's' || $d eq 'd' );
|
if ($d eq 's' || $d eq 'd' );
|
||||||
# compose desc_$n$d to get myized message, provide values
|
# compose desc_$n$d to get myized message, provide values
|
||||||
# as $1, ..., $n
|
# as $1, ..., $n
|
||||||
|
if ($d eq 'match-set') {
|
||||||
|
$v[1] = $text{'desc_'.$d.'_'.$v[1]} || $v[1];
|
||||||
|
}
|
||||||
my $txt = &text("desc_$d$n", map { "<b>$_</b>" } @v);
|
my $txt = &text("desc_$d$n", map { "<b>$_</b>" } @v);
|
||||||
push(@c, $txt) if ($txt);
|
push(@c, $txt) if ($txt);
|
||||||
}
|
}
|
||||||
|
@ -435,34 +435,34 @@ else {
|
|||||||
# may need to check if they are used by firewall rules
|
# may need to check if they are used by firewall rules
|
||||||
@ipsets = &get_ipsets_active();
|
@ipsets = &get_ipsets_active();
|
||||||
if (@ipsets) {
|
if (@ipsets) {
|
||||||
print &ui_hr();
|
print &ui_hr();
|
||||||
print "<b>$text{'index_ipset_title'}</b>";
|
print "<b>$text{'index_ipset_title'}</b>";
|
||||||
|
|
||||||
# Generate the header
|
# Generate the header
|
||||||
@hcols = ( $text{'index_ipset'},
|
@hcols = ( $text{'index_ipset'},
|
||||||
$text{'index_ipset_name'},
|
$text{'index_ipset_name'},
|
||||||
$text{'index_ipset_type'},
|
$text{'index_ipset_type'},
|
||||||
$text{'index_ipset_elem'},
|
$text{'index_ipset_elem'},
|
||||||
$text{'index_ipset_maxe'},
|
$text{'index_ipset_maxe'},
|
||||||
$text{'index_ipset_size'} );
|
$text{'index_ipset_size'} );
|
||||||
print &ui_columns_start(\@hcols, 100, 0);
|
print &ui_columns_start(\@hcols, 100, 0);
|
||||||
|
|
||||||
# Generate a row for each rule
|
# Generate a row for each rule
|
||||||
foreach $s (@ipsets) {
|
foreach $s (@ipsets) {
|
||||||
my @h = split(/ /, $s->{'Header'});
|
my @h = split(/ /, $s->{'Header'});
|
||||||
# print matching pínet version
|
# print matching pínet version
|
||||||
if ($h[1] =~ /inet${ipvx}$/) {
|
if ($h[1] =~ /inet${ipvx}$/) {
|
||||||
my @cols = ( "$h[0] $h[1]",
|
my @cols = ( "$h[0] $h[1]",
|
||||||
$s->{'Name'},
|
$s->{'Name'},
|
||||||
$s->{'Type'},
|
$s->{'Type'},
|
||||||
$s->{'Number'} || 0,
|
$s->{'Number'} || 0,
|
||||||
$h[5],
|
$h[5],
|
||||||
$s->{'Size'} );
|
$s->{'Size'} );
|
||||||
print &ui_columns_row(\@cols);
|
print &ui_columns_row(\@cols);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
print &ui_columns_end();
|
||||||
print &ui_columns_end();
|
}
|
||||||
}
|
|
||||||
|
|
||||||
# Display buttons for applying and un-applying the configuration,
|
# Display buttons for applying and un-applying the configuration,
|
||||||
# and for creating an init script if possible
|
# and for creating an init script if possible
|
||||||
|
@ -142,6 +142,8 @@ desc_tos=type of service field is $1
|
|||||||
desc_tos!=type of service field is not $1
|
desc_tos!=type of service field is not $1
|
||||||
desc_match-set=$2 matches IPset $1
|
desc_match-set=$2 matches IPset $1
|
||||||
desc_match-set!=$2 does not match IPset $1
|
desc_match-set!=$2 does not match IPset $1
|
||||||
|
desc_match-set_src=incoming traffic
|
||||||
|
desc_match-set_dst=outgoing traffic
|
||||||
desc_physdev-in=input physical interface is $1
|
desc_physdev-in=input physical interface is $1
|
||||||
desc_physdev-in!=input physical interface is not $1
|
desc_physdev-in!=input physical interface is not $1
|
||||||
desc_physdev-out=output physical interface is $1
|
desc_physdev-out=output physical interface is $1
|
||||||
|
Reference in New Issue
Block a user