aboutsummaryrefslogtreecommitdiffstats
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
parent6d6abea43a8bfc21bbc495660704e1ef33d498eb (diff)
downloadpfsense-packages-c29ea7d5db2aa0a4408c00e31e012ada6887936e.tar.gz
pfsense-packages-c29ea7d5db2aa0a4408c00e31e012ada6887936e.tar.bz2
pfsense-packages-c29ea7d5db2aa0a4408c00e31e012ada6887936e.zip
Show port detail on hover over count.
-rw-r--r--config/states-summary/diag_states_summary.php18
-rwxr-xr-xpkg_config.7.xml2
2 files changed, 17 insertions, 3 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 } ?>
diff --git a/pkg_config.7.xml b/pkg_config.7.xml
index 97f5efd2..1fb6fb8c 100755
--- a/pkg_config.7.xml
+++ b/pkg_config.7.xml
@@ -966,7 +966,7 @@
<name>States Summary</name>
<descr>States Summary Page, which will summarize firewall states by IP address and protocol.</descr>
<category>System</category>
- <version>0.4</version>
+ <version>0.5</version>
<status>Beta</status>
<maintainer>jimp@pfsense.org</maintainer>
<required_version>1.2.3</required_version>