summaryrefslogtreecommitdiffstats
path: root/usr/local/www/diag_states_summary.php
diff options
context:
space:
mode:
authorjim-p <jim@pingle.org>2010-02-06 01:03:30 -0500
committerjim-p <jim@pingle.org>2010-02-06 01:03:30 -0500
commit2a63c863f5545dd967eef61c88294ea188bd04fa (patch)
tree666044ac54c60315172eaa36122539c092d407f3 /usr/local/www/diag_states_summary.php
parent63284430301636fb0887faffd41cc09e02ce0144 (diff)
downloadpfsense-2a63c863f5545dd967eef61c88294ea188bd04fa.zip
pfsense-2a63c863f5545dd967eef61c88294ea188bd04fa.tar.gz
Show port detail on hover over count
Diffstat (limited to 'usr/local/www/diag_states_summary.php')
-rw-r--r--usr/local/www/diag_states_summary.php18
1 files changed, 16 insertions, 2 deletions
diff --git a/usr/local/www/diag_states_summary.php b/usr/local/www/diag_states_summary.php
index fddf0ba..45600a0 100644
--- a/usr/local/www/diag_states_summary.php
+++ b/usr/local/www/diag_states_summary.php
@@ -102,6 +102,20 @@ function sort_by_ip($a, $b) {
return sprintf("%u", ip2long($a)) < sprintf("%u", ip2long($b)) ? -1 : 1;
}
+function build_port_info($portarr, $proto) {
+ $ports = array();
+ asort($portarr);
+ foreach (array_reverse($portarr, TRUE) as $port => $count) {
+ $str = "";
+ $service = getservbyport($port, strtolower($proto));
+ $port = "{$proto}/{$port}";
+ if ($service)
+ $port = "{$port} ({$service})";
+ $ports[] = "{$port}: {$count}";
+ }
+ return implode($ports, ', ');
+}
+
function print_summary_table($label, $iparr, $sort = TRUE) { ?>
<h3><?php echo $label; ?></h3>
@@ -131,8 +145,8 @@ function print_summary_table($label, $iparr, $sort = TRUE) { ?>
<td class='list'>&nbsp;</td>
<td class='listlr'><?php echo $proto; ?></td>
<td class='listr' align="center"><?php echo $protoinfo['seen']; ?></td>
- <td class='listr' align="center"><?php echo count($protoinfo['srcports']); ?></td>
- <td class='listr' align="center"><?php echo count($protoinfo['dstports']); ?></td>
+ <td class='listr' align="center"><span title="<?php echo build_port_info($protoinfo['srcports'], $proto); ?>"><?php echo count($protoinfo['srcports']); ?></span></td>
+ <td class='listr' align="center"><span title="<?php echo build_port_info($protoinfo['dstports'], $proto); ?>"><?php echo count($protoinfo['dstports']); ?></span></td>
</tr>
<?php } ?>
<?php } ?>
OpenPOWER on IntegriCloud