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"); ?>
=$pgtitle?>
IP | # States | Proto | # States | Src Ports | Dst Ports |
---|---|---|---|---|---|