From b99c16aee8e9de7716b33600e61c9316697c8602 Mon Sep 17 00:00:00 2001 From: Christian Dresel Date: Sun, 19 Aug 2018 11:14:57 +0200 Subject: [PATCH] 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].'