summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorPiBa-NL <pba_2k3@yahoo.com>2012-09-08 14:41:30 +0200
committerPiBa-NL <pba_2k3@yahoo.com>2012-09-08 14:41:30 +0200
commita6d5e0439da3945c77beeb5bab5956223973cc80 (patch)
tree496f9eab3bea0d5c5c390b502fc4ada8c580cf0f /etc
parentc184fa273f8f575266addc38f838a31b763d3d1d (diff)
downloadpfsense-a6d5e0439da3945c77beeb5bab5956223973cc80.zip
pfsense-a6d5e0439da3945c77beeb5bab5956223973cc80.tar.gz
Changed firewall log to show the applied rule description directly on screen, also layout optimization for "Show raw filter logs".
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/filter_log.inc35
1 files changed, 35 insertions, 0 deletions
diff --git a/etc/inc/filter_log.inc b/etc/inc/filter_log.inc
index 3a75f30..11adfae 100644
--- a/etc/inc/filter_log.inc
+++ b/etc/inc/filter_log.inc
@@ -226,6 +226,41 @@ function find_rule_by_number($rulenum, $type="rules") {
return `pfctl -vvsr | grep '^@{$rulenum} '`;
}
+function buffer_rules_load() {
+ global $buffer_rules_rdr, $buffer_rules_normal;
+ $buffer = explode("\n",`pfctl -vvsn -a "miniupnpd" | grep '^@'`);
+ foreach ($buffer as $line) {
+ list($key, $value) = explode (" ", $line, 2);
+ $buffer_rules_rdr[$key] = $value;
+ }
+ $buffer = explode("\n",`pfctl -vvsr | grep '^@'`);
+ foreach ($buffer as $line) {
+ list($key, $value) = explode (" ", $line, 2);
+ $buffer_rules_normal[$key] = $value;
+ }
+}
+
+function buffer_rules_clear() {
+ unset($GLOBALS['buffer_rules_normal']);
+ unset($GLOBALS['buffer_rules_rdr']);
+}
+
+function find_rule_by_number_buffer($rulenum, $type){
+ global $g, $buffer_rules_rdr, $buffer_rules_normal;
+
+ if ($type == "rdr")
+ {
+ $ruleString = $buffer_rules_rdr["@".$rulenum];
+ //TODO: get the correct 'description' part of a RDR log line. currently just first 30 characters..
+ $rulename = substr($ruleString,0,30);
+ } else {
+ $ruleString = $buffer_rules_normal["@".$rulenum];
+ list(,$rulename,) = explode("\"",$ruleString);
+ $rulename = str_replace("USER_RULE: ","<img src=\"/themes/".$g['theme'].'/images/icons/icon_frmfld_user.png\" width="11" height="12" title="USER_RULE" alt="USER_RULE"/> ',$rulename);
+ }
+ return "@".$rulenum." ".$rulename;
+}
+
function find_action_image($action) {
global $g;
if ((strstr(strtolower($action), "p")) || (strtolower($action) == "rdr"))
OpenPOWER on IntegriCloud