# HG changeset patch # User Matti Hamalainen # Date 1250372085 -10800 # Node ID e7e484c89dbcb31e8800c367926e88b048887b31 # Parent 0d463c6570b6b05a85e2c4a054f6c8e575269a23 Added highlighting of blocked entries in summary tables. diff -r 0d463c6570b6 -r e7e484c89dbc README --- a/README Sat Aug 15 23:49:58 2009 +0300 +++ b/README Sun Aug 16 00:34:45 2009 +0300 @@ -1,4 +1,4 @@ -Malicious Attack Livid Termination Filter daemon (maltfilter) v0.10.1 +Malicious Attack Livid Termination Filter daemon (maltfilter) v0.10.2 ===================================================================== Programmed by Matti 'ccr' Hämäläinen (C) Copyright 2009 Tecnic Software productions (TNSP) diff -r 0d463c6570b6 -r e7e484c89dbc maltfilter --- a/maltfilter Sat Aug 15 23:49:58 2009 +0300 +++ b/maltfilter Sun Aug 16 00:34:45 2009 +0300 @@ -10,7 +10,7 @@ use Date::Parse; use Net::IP; -my $progversion = "0.10.1"; +my $progversion = "0.10.2"; my $progbanner = "Malicious Attack Livid Termination Filter daemon (maltfilter) v$progversion\n". "Programmed by Matti 'ccr' Hamalainen \n". @@ -181,11 +181,12 @@ } } -sub printTD($$$) +sub printTD { my $fh = $_[1]; if ($_[0]) { - print $fh "".$_[2].""; + my $s = defined($_[3]) ? " class=\"$_[3]\"" : ""; + print $fh "".$_[2].""; } else { print $fh $_[2]; } @@ -250,7 +251,8 @@ ); foreach my $mip (sort { $func->($table, $a, $b) } keys %{$keys}) { - printElem($m, $f, " "); + my $blocked = defined($blocklist{$mip}) ? "blocked" : "unblocked"; + printElem($m, $f, " "); printTD($m, $f, sprintf(bb($m)."%-10d".eb($m), $table->{$mip}{"hits"})); printElem(!$m, $f, " | "); printTD($m, $f, sprintf("%-15s", getLink($m, $mip))); @@ -296,14 +298,15 @@ $str2." || ".$str2."\n"); my $printEntry = sub { - printTD($m, $f, sprintf("%-15s", getLink($m, $_[0]))); + my $blocked = defined($blocklist{$_[0]}) ? "blocked" : "unblocked"; + printTD($m, $f, sprintf("%-15s", getLink($m, $_[0])), $blocked); printElem(!$m, $f, " | "); - printTD($m, $f, sprintf("%-8d ", $table->{$_[0]}{"hits"})); + printTD($m, $f, sprintf("%-8d ", $table->{$_[0]}{"hits"}), $blocked); printElem(!$m, $f, " | "); - printTD($m, $f, scalar localtime($table->{$_[0]}{"date2"})); + printTD($m, $f, scalar localtime($table->{$_[0]}{"date2"}), $blocked); printElem(!$m, $f, " | "); - my $tmp = join(", ", sort keys %{$table->{$_[0]}{"reason"}}); - printTD($m, $f, sprintf("%-30s", $tmp)); + my $tmp = join(", ", sort keys %{$table->{$_[0]}{"reason"}}, $blocked); + printTD($m, $f, sprintf("%-30s", $tmp), $blocked); $nhits += $table->{$_[0]}{"hits"}; };