From ff80344b4db347488a089922639a9dc49edf7081 Mon Sep 17 00:00:00 2001 From: Christian Dresel Date: Sun, 19 Aug 2018 09:27:34 +0200 Subject: [PATCH 1/6] Fix neighbour table Signed-off-by: Christian Dresel --- index.php | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/index.php b/index.php index 93b5c00..2ea60a7 100644 --- a/index.php +++ b/index.php @@ -68,16 +68,23 @@ ); } foreach ($neighbour as $temp) { - $tempdata = explode(" ", $temp); + $address=explode(" ",strstr($temp,"address")); + $interface=explode(" ",strstr($temp,"interface")); + $reach=explode(" ",strstr($temp,"reach")); + $rxcost=explode(" ",strstr($temp,"rxcost")); + $txcost=explode(" ",strstr($temp,"txcost")); + $rtt=explode(" ",strstr($temp,"rtt")); + $rttcost=explode(" ",strstr($temp,"rttcost")); + $cost=explode(" ",strstr($temp,"cost")); $output['neighbours'][] = array( - 'address' => $tempdata[4], - 'interface' => $tempdata[6], - 'reach' => $tempdata[8], - 'rxcost' => $tempdata[10], - 'txcost' => $tempdata[12], - 'rtt' => $tempdata[14], - 'rttcost' => $tempdata[16], - 'cost' => $tempdata[18], + 'address' => $address[1], + 'interface' => $interface[1], + 'reach' => $reach[1], + 'rxcost' => $rxcost[1], + 'txcost' => $txcost[1], + 'rtt' => $rtt[1], + 'rttcost' => $rttcost[1], + 'cost' => $cost[1], ); } From 3e0bcf1cbed9b67a796c74cfd1d4960505709a6e Mon Sep 17 00:00:00 2001 From: Christian Dresel Date: Sun, 19 Aug 2018 09:40:16 +0200 Subject: [PATCH 2/6] Wegetabelle nach oben verschoben Wenn man sie anklickt, will man sie auch sehen und nicht bis ganz nach unten scrollen Signed-off-by: Christian Dresel --- index.php | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/index.php b/index.php index 2ea60a7..c59477d 100644 --- a/index.php +++ b/index.php @@ -117,6 +117,28 @@ echo ""; foreach($output['data'] as $temp) { echo ""; } echo "
$temp
"; + + if($_GET['ip'] != '') { + echo '

Wege zu '.$_GET["ip"].'

'; + echo ' + + + + + + + + '; + foreach($output['routes'] as $route) { + if ($route['target'] == $_GET['ip']) { + echo ""; + foreach($route as $temp) { echo ""; } + echo ""; + } + } + echo "
targetinstalledviadevicemetricDestination ID
$temp
"; + } + echo "

Interfaces

"; echo ' @@ -223,27 +245,6 @@ echo "
"; } - if($_GET['ip'] != '') { - echo '

Wege zu '.$_GET["ip"].'

'; - echo ' - - - - - - - - '; - foreach($output['routes'] as $route) { - if ($route['target'] == $_GET['ip']) - { - echo ""; - foreach($route as $temp) { echo ""; } - echo ""; - } - } - echo "
targetinstalledviadevicemetricDestination ID
$temp
"; - } } ?>
From da915a05a70dbfed3015e7fb5184de489528c156 Mon Sep 17 00:00:00 2001 From: Christian Dresel Date: Sun, 19 Aug 2018 09:47:48 +0200 Subject: [PATCH 3/6] GET anstatt POST Damit bei F5 der Browser nicht immer nervt mit: "Wollen Sie die Daten nochmal senden?" Signed-off-by: Christian Dresel --- index.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.php b/index.php index c59477d..b9bf5ad 100644 --- a/index.php +++ b/index.php @@ -183,7 +183,7 @@ echo ""; } echo ""; - if($_REQUEST['routes'] == '1') { + if($_GET['routes'] == '1') { echo "

routes

"; echo ' @@ -203,7 +203,7 @@ } - if($_REQUEST['v4table'] == '1') { + if($_GET['v4table'] == '1') { echo "

ipv4 routing table

"; echo '
'; $v4routen = shell_exec('ip r s t $(grep import-table /etc/babeld.conf | cut -f2 -d" ")'); @@ -224,7 +224,7 @@ echo "
"; } - if($_REQUEST['v6table'] == '1') { + if($_GET['v6table'] == '1') { echo "

ipv6 routing table

"; echo ''; $v6routen = shell_exec('ip -6 r s t $(grep import-table /etc/babeld.conf | cut -f2 -d" ")'); @@ -248,7 +248,7 @@ } ?>
- + From 9a922cf2380e1dca6e1dbacc5bca297be501382b Mon Sep 17 00:00:00 2001 From: Christian Dresel Date: Sun, 19 Aug 2018 09:50:20 +0200 Subject: [PATCH 4/6] Die zuvielemn / entfernt Signed-off-by: Christian Dresel --- index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index b9bf5ad..58a8700 100644 --- a/index.php +++ b/index.php @@ -213,7 +213,7 @@ $line = explode(" ", $v4route[$i]); for($n = 0; $n < 5; ++$n) { if ($n == 0) { - echo ''; + echo ''; } else { echo ''; @@ -234,7 +234,7 @@ $line = explode(" ", $v6route[$i]); for($n = 0; $n < 8; ++$n) { if ($n == 0) { - echo ''; + echo ''; } else { echo ''; From 43a4cf593693d966503cd0eeefa460e4b039ab1c Mon Sep 17 00:00:00 2001 From: Christian Dresel Date: Sun, 19 Aug 2018 09:58:23 +0200 Subject: [PATCH 5/6] Link zum Weg bei allen routen Signed-off-by: Christian Dresel --- index.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index 58a8700..4b7aed2 100644 --- a/index.php +++ b/index.php @@ -195,8 +195,17 @@ '; foreach($output['routes'] as $route) { + $set=0; echo ""; - foreach($route as $temp) { echo ""; } + foreach($route as $temp) { + if ($set == 0) { + echo ''; + $set=1; + } + else { + echo ""; + } + } echo ""; } echo "
'.$line[$n].''.$line[$n].''.$line[$n].''.$line[$n].''.$line[$n].''.$line[$n].'Destination ID
$temp'.$temp.'$temp
"; From b99c16aee8e9de7716b33600e61c9316697c8602 Mon Sep 17 00:00:00 2001 From: Christian Dresel Date: Sun, 19 Aug 2018 11:14:57 +0200 Subject: [PATCH 6/6] Fix ipv6 routing table table Signed-off-by: Christian Dresel --- index.php | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/index.php b/index.php index 4b7aed2..b8cfe11 100644 --- a/index.php +++ b/index.php @@ -235,20 +235,41 @@ if($_GET['v6table'] == '1') { echo "

ipv6 routing table

"; - echo ''; + echo '
+ + + + + + + + '; $v6routen = shell_exec('ip -6 r s t $(grep import-table /etc/babeld.conf | cut -f2 -d" ")'); $v6route = explode(PHP_EOL, $v6routen); for($i = 0; $i < count($v6route); ++$i) { echo ""; - $line = explode(" ", $v6route[$i]); + /*$line = explode(" ", $v6route[$i]); for($n = 0; $n < 8; ++$n) { - if ($n == 0) { - echo ''; - } - else { - echo ''; - } - } + if ($n == 0) { + echo ''; + } + else { + echo ''; + } + }*/ + $destination=explode(" ", $v6route[$i]); + $source=explode(" ", strstr($v6route[$i],"from")); + $via=explode(" ", strstr($v6route[$i],"via")); + $device=explode(" ", strstr($v6route[$i],"dev")); + $proto=explode(" ", strstr($v6route[$i],"proto")); + $metric=explode(" ", strstr($v6route[$i],"metric")); + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ""; }
DestinationSource SpecificviaDeviceprotoKernelmetric
'.$line[$n].''.$line[$n].''.$line[$n].''.$line[$n].''.$destination[0].''.$source[1].''.$via[1].''.$device[1].''.$proto[1].''.$metric[1].'