aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorjim-p <jim@pingle.org>2010-02-06 01:02:40 -0500
committerjim-p <jim@pingle.org>2010-02-06 01:02:40 -0500
commitc29ea7d5db2aa0a4408c00e31e012ada6887936e (patch)
tree32f76a7be9d1085e1559360f994556e88bc2ddaa /config
parent6d6abea43a8bfc21bbc495660704e1ef33d498eb (diff)
downloadpfsense-packages-c29ea7d5db2aa0a4408c00e31e012ada6887936e.tar.gz
pfsense-packages-c29ea7d5db2aa0a4408c00e31e012ada6887936e.tar.bz2
pfsense-packages-c29ea7d5db2aa0a4408c00e31e012ada6887936e.zip
Show port detail on hover over count.
Diffstat (limited to 'config')
-rw-r--r--config/states-summary/diag_states_summary.php18
1 files changed, 16 insertions, 2 deletions
diff --git a/config/states-summary/diag_states_summary.php b/config/states-summary/diag_states_summary.php
index 26697bb7..973c2630 100644
--- a/config/states-summary/diag_states_summary.php
+++ b/config/states-summary/diag_states_summary.php
@@ -90,6 +90,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>
@@ -119,8 +133,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 } ?>