diff options
-rw-r--r-- | config/states-summary/diag_states_summary.php | 18 | ||||
-rwxr-xr-x | pkg_config.7.xml | 2 |
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'> </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> |