From 56f3f5643174df0e678a0e399c841b61037cb9fd Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Thu, 10 Mar 2016 22:16:57 +0100 Subject: [PATCH] (legacy) refactor diag_dump_states.php --- src/www/diag_dump_states.php | 391 +++++++++++++++-------------------- 1 file changed, 163 insertions(+), 228 deletions(-) diff --git a/src/www/diag_dump_states.php b/src/www/diag_dump_states.php index 54a401c6b..17d4dcc11 100644 --- a/src/www/diag_dump_states.php +++ b/src/www/diag_dump_states.php @@ -1,31 +1,31 @@ + +
+
+
+
+
+
+ + + + + + + + + + + + + + + + +
+ "/> + + " /> + + " /> + +
+
+
+
+
+
+
+
+ + + + + + + + + + += 10000) { + break; + } + $line_split = preg_split("/\s+/", $line); + $iface = array_shift($line_split); + $proto = array_shift($line_split); + $state = array_pop($line_split); + $info = htmlspecialchars(implode(" ", $line_split)); + // We may want to make this optional, with a large state table, this could get to be expensive. + $iface = convert_real_interface_to_friendly_descr($iface); -
-
-
-
-
-
- - -
Router -> Destination");?>
- - - - - - - - - -
: " /> - - " /> - -
- - - - -
- -
- -
- -
- - - - - - - - - - = 10000) - break; - - $line_split = preg_split("/\s+/", $line); - - $iface = array_shift($line_split); - $proto = array_shift($line_split); - $state = array_pop($line_split); - $info = implode(" ", $line_split); - - // We may want to make this optional, with a large state table, this could get to be expensive. - $iface = convert_real_interface_to_friendly_descr($iface); - - /* break up info and extract $srcip and $dstip */ - $ends = preg_split("/\?/", $info); - $parts = explode(":", $ends[0]); - $srcip = trim($parts[0]); - $parts = explode(":", $ends[count($ends) - 1]); - $dstip = trim($parts[0]); - - ?> - - - - - - - - - - - - - -
- - - - - -
- -
-
- - - - - -
- -
-
- - - - - -
Router -> Destination");?> - -
-
- - - - - -
- -
-
- - - -
- -
- - -

:

- - -
-
- -
-
-
-
-
-
-
+ /* break up info and extract $srcip and $dstip */ + $ends = preg_split("/\?/", $info); + $parts = explode(":", $ends[0]); + $srcip = trim($parts[0]); + $parts = explode(":", $ends[count($ends) - 1]); + $dstip = trim($parts[0]); + // states can be deleted by source / dest combination, all matching records use the same class. + $rowid = str_replace(array('.', ':'), '_', $srcip.$dstip); + ?> + + + + + + + + + + + + + + + + + + + : + + + + + + + + + + +