From eb76bc428d6730539e12ef9f90e59e3fc0fbd437 Mon Sep 17 00:00:00 2001 From: jim-p Date: Wed, 3 Feb 2010 21:27:55 -0500 Subject: New states summary page/package. Pretty basic to start with. --- config/states-summary/diag_states_summary.php | 81 +++++++++++++++++++++++++++ config/states-summary/states-summary.xml | 70 +++++++++++++++++++++++ 2 files changed, 151 insertions(+) create mode 100644 config/states-summary/diag_states_summary.php create mode 100644 config/states-summary/states-summary.xml (limited to 'config/states-summary') diff --git a/config/states-summary/diag_states_summary.php b/config/states-summary/diag_states_summary.php new file mode 100644 index 00000000..427888dc --- /dev/null +++ b/config/states-summary/diag_states_summary.php @@ -0,0 +1,81 @@ + 0) { + foreach($states as $line) { + $line_split = preg_split("/\s+/", $line); + $type = array_shift($line_split); + $proto = array_shift($line_split); + $state = array_pop($line_split); + $info = implode(" ", $line_split); + + /* break up info and extract $srcip and $dstip */ + $ends = preg_split("/\?/", $info); + $parts = split(":", $ends[0]); + $srcip = trim($parts[0]); + $srcport = trim($parts[1]); + + $parts = split(":", $ends[count($ends) - 1]); + $dstip = trim($parts[0]); + $dstport = trim($parts[1]); + + $srcipinfo[$srcip]['seen']++; + $srcipinfo[$srcip]['protos'][$proto]['seen']++; + if (!empty($srcport)) { + $srcipinfo[$srcip]['protos'][$proto]['srcports'][$srcport]++; + } + if (!empty($dstport)) { + $srcipinfo[$srcip]['protos'][$proto]['dstports'][$dstport]++; + } + } +} + +function sort_by_ip($a, $b) { + return sprintf("%u", ip2long($a)) < sprintf("%u", ip2long($b)) ? -1 : 1; +} + +$pgtitle = "Diagnostics: State Table Summary"; +require_once("guiconfig.inc"); +include("head.inc"); +include("fbegin.inc"); +?> +

+ + + + + + + + + + + $ipinfo) { ?> + + + + + + + + + $protoinfo) { ?> + + + + + + + + + + + +
IP# StatesProto# StatesSrc PortsDst Ports
  
+ + diff --git a/config/states-summary/states-summary.xml b/config/states-summary/states-summary.xml new file mode 100644 index 00000000..1f4d7527 --- /dev/null +++ b/config/states-summary/states-summary.xml @@ -0,0 +1,70 @@ + + + + + + . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ + ]]> + + States Summary Page + None + Currently there are no FAQ items provided. + States Summary + 1.0 + Diagnostics: States Summart + + States Summary + +
Diagnostics
+ /diag_states_summary.php +
+ + /usr/local/www/ + 077 + http://www.pfsense.com/packages/config/states-summary/diag_states_summary.php + + + + +
\ No newline at end of file -- cgit v1.2.3