From 9bccbdf46d1ac7c8dc41612a1a6a5e1120fcf326 Mon Sep 17 00:00:00 2001 From: Marcello Coutinho Date: Fri, 11 Nov 2011 02:14:08 -0200 Subject: pfBlocker - version 0.1.4.5 is out with lists update frequency and widget rule package count --- config/pf-blocker/pfBlocker.widget.php | 40 +++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) (limited to 'config/pf-blocker/pfBlocker.widget.php') diff --git a/config/pf-blocker/pfBlocker.widget.php b/config/pf-blocker/pfBlocker.widget.php index 53b39ad9..239bfb49 100644 --- a/config/pf-blocker/pfBlocker.widget.php +++ b/config/pf-blocker/pfBlocker.widget.php @@ -28,7 +28,7 @@ @require_once("guiconfig.inc"); @require_once("pfsense-utils.inc"); @require_once("functions.inc"); - +?>
"; @@ -47,6 +47,16 @@ foreach ($config['aliases']['alias'] as $cbalias){ } } } + +#check rule count +#(label, evaluations,packets total, bytes total, packets in, bytes in,packets out, bytes out) +$packets=exec("/sbin/pfctl -s labels",$debug); +foreach ($debug as $line){ + #USER_RULE: pfBlocker Outbound rule 1656 0 0 0 0 0 0 + if (preg_match("/USER_RULE: (\w+).*\s+\d+\s+(\d+)\s+\d+\s+\d+\s+\d+\s+\d+\s+\d+/",$line,$matches)) + ${$matches[1]}+=$matches[2]; +} + $rules=$config['filter']['rule']; #echo "
";
 foreach($rules as $rule){
@@ -61,14 +71,34 @@ print "
";
 #exit;
 	print "Alias";
 	print "CIDRs";
+	print "Packets";
 	print "Status";	
-
-
 foreach ($pfb_table as $alias => $values){
 	print "".$alias ."";
 	print "".$values["count"]."";
+	print "".${$alias}."";
 	print "".$values["img"]."";	
 }
 echo"  ";
-echo"";
-?>
\ No newline at end of file
+echo"
"; +?> + \ No newline at end of file -- cgit v1.2.3