diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-02-28 18:29:37 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-02-28 18:29:37 +0000 |
commit | cc869478c7a3213ba6848cab92edc880433317f8 (patch) | |
tree | 72f5e8462dc8d93b9b455446f23effbc9a9e1900 | |
parent | e33c869497fa0afd49ecf87a7b89432fd84015cc (diff) | |
download | pfsense-cc869478c7a3213ba6848cab92edc880433317f8.zip pfsense-cc869478c7a3213ba6848cab92edc880433317f8.tar.gz |
Cleanup non-raw filter logs so more.
-rw-r--r-- | etc/inc/pfsense-utils.inc | 19 | ||||
-rwxr-xr-x | usr/local/www/diag_logs_filter.php | 11 |
2 files changed, 26 insertions, 4 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 2ae8aa5..83c448b 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -483,6 +483,25 @@ function execute_command_return_output($command) { } /* + * convert_real_interface_to_friendly_interface_name($interface): convert fxp0 -> wan, etc. + */ +function convert_real_interface_to_friendly_interface_name($interface) { + global $config; + $i = 0; + $ifdescrs = array('wan', 'lan'); + for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++) { + $ifdescrs['opt' . $j] = "opt" . $j; + } + foreach ($ifdescrs as $ifdescr => $ifname) { + $int = filter_translate_type_to_real_interface($ifname); + $ifconfig = exec_command("/sbin/ifconfig {$int}"); + if(stristr($ifconfig,$interface) <> false) + return $ifname; + } + return $interface; +} + +/* * update_progress_bar($percent): updates the javascript driven progress bar. */ function update_progress_bar($percent) { diff --git a/usr/local/www/diag_logs_filter.php b/usr/local/www/diag_logs_filter.php index fe0eaa5..146f900 100755 --- a/usr/local/www/diag_logs_filter.php +++ b/usr/local/www/diag_logs_filter.php @@ -81,7 +81,7 @@ function conv_clog($logfile, $tail) { $filterlog = array(); foreach ($logarr as $logent) { - $dontdisplay = 1; + $dontdisplay = 0; $master_split = preg_split("/rule/", $logent); $first_split = preg_split("/\s+/", $master_split[0]); @@ -91,7 +91,8 @@ function conv_clog($logfile, $tail) { $flent['time'] = $first_split[0] . ", " . $first_split[1] . " " . $first_split[2]; $flent['interface'] = $second_split[5]; - $flent['proto'] = $second_split[11]; + + $flent['proto'] = $second_split[10]; $flent['act'] = $second_split[1]; $flent['src'] = format_ipf_ip($second_split[7]); $flent['dst'] = format_ipf_ip($second_split[9]); @@ -100,7 +101,9 @@ function conv_clog($logfile, $tail) { $flent['dst'] = ereg_replace(":", "", $flent['dst']); $flent['interface'] = ereg_replace(":", "", $flent['interface']); - if($second_split[11] == "UDP" or $second_split[11] == "TCP") $dontdisplay = 0; + if($second_split[11] == "udp" or $second_split[11] == "tcp" or $second_split[11] == "icmp" or $second_split[11] == "igmp") $flent['proto'] = $second_split[11]; + + if($flent['proto'] == "S" or $flent['proto'] == "R") $dontdisplay = 1; if($dontdisplay == 0) $filterlog[] = $flent; @@ -167,7 +170,7 @@ function format_ipf_ip($ipfip) { <img src="<?=$img;?>" width="11" height="11" align="absmiddle"> <?php if ($filterent['count']) echo $filterent['count'];?></td> <td class="listr" nowrap><?=htmlspecialchars($filterent['time']);?></td> - <td class="listr" nowrap><?=htmlspecialchars($filterent['interface']);?></td> + <td class="listr" nowrap><?=htmlspecialchars(convert_real_interface_to_friendly_interface_name($filterent['interface']));?></td> <td class="listr" nowrap><?=htmlspecialchars($filterent['src']);?></td> <td class="listr" nowrap><?=htmlspecialchars($filterent['dst']);?></td> <td class="listr" nowrap><?=htmlspecialchars($filterent['proto']);?></td> |