summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2014-03-14 17:46:08 -0300
committerRenato Botelho <garga@FreeBSD.org>2014-04-14 09:47:32 -0300
commit115b7b81835df0aaf37f305042382911dd719245 (patch)
treecdbe056e7d8df080eff22955ee15c8933ef3e3f7 /usr
parent2a438d7e4cd6fda65078e7c16ff5f012a07b3b18 (diff)
downloadpfsense-115b7b81835df0aaf37f305042382911dd719245.zip
pfsense-115b7b81835df0aaf37f305042382911dd719245.tar.gz
Start using filterlog
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/bin/filterparser.php31
-rw-r--r--usr/local/www/diag_logs_filter.php2
2 files changed, 4 insertions, 29 deletions
diff --git a/usr/local/bin/filterparser.php b/usr/local/bin/filterparser.php
index 730d728..799a6e1 100755
--- a/usr/local/bin/filterparser.php
+++ b/usr/local/bin/filterparser.php
@@ -47,36 +47,11 @@ $lastline = "";
while(!feof($log)) {
$line = fgets($log);
$line = rtrim($line);
- $line_split = "";
- preg_match("/.*\spf:\s(.*)/", $line, $line_split);
- if (substr($line_split[1], 0, 4) != " ") {
- $flent = "";
- if (($lastline != "") && (substr($lastline, 0, 1) != " ")) {
- $flent = parse_filter_line(trim($lastline));
- }
- $lastline = $line;
- } else {
- $lastline .= substr($line_split[1], 3);
- }
- /* Available fields:
- time - Time the packet was seen
- rulenum - Rule number matched
- act - Action (pass/block)
- interface - Friendly interface name (WAN, LAN, etc)
- realint - Real interface name (fxp0, em0, vr0, etc)
- proto - Protocol (e.g. TCP, UDP, ICMP, etc)
- tcpflags - TCP flags/control bits
- src - Source address with port
- srcip - Source IP
- srcport - Source Port
- dst - Destination address with port
- dstip - Destination IP
- dstport - Destination Port
- */
- $flags = (($flent['proto'] == "TCP") && !empty($flent['tcpflags'])) ? ":" . $flent['tcpflags'] : "";
+ $flent = parse_filter_line(trim($line));
if ($flent != "") {
+ $flags = (($flent['proto'] == "TCP") && !empty($flent['tcpflags'])) ? ":" . $flent['tcpflags'] : "";
echo "{$flent['time']} {$flent['act']} {$flent['realint']} {$flent['proto']}{$flags} {$flent['src']} {$flent['dst']}\n";
$flent = "";
}
}
-fclose($log); ?> \ No newline at end of file
+fclose($log); ?>
diff --git a/usr/local/www/diag_logs_filter.php b/usr/local/www/diag_logs_filter.php
index 0f38ce7..5f21504 100644
--- a/usr/local/www/diag_logs_filter.php
+++ b/usr/local/www/diag_logs_filter.php
@@ -356,7 +356,7 @@ include("head.inc");
$int = strtolower($filterent['interface']);
$proto = strtolower($filterent['proto']);
- if(is_ipaddrv6($filterent['srcip'])) {
+ if($filterent['version'] == '6') {
$ipproto = "inet6";
$filterent['srcip'] = "[{$filterent['srcip']}]";
$filterent['dstip'] = "[{$filterent['dstip']}]";
OpenPOWER on IntegriCloud