diff --git a/index.php b/index.php index 6eeb31b..eb7af3d 100644 --- a/index.php +++ b/index.php @@ -1,3 +1,57 @@ + 255) { + + die("Ein Teilstück der IP Adresse ist grö&szli;ger als 255."); + + } + + } + + } + + } + + } + + // Noch nicht abgebrochen? -> True zurückliefern + return true; + +} +?> +
@@ -22,7 +76,7 @@ '.$file.''); - while (1) { +/* while (1) { $read = socket_read($sock, 1024, PHP_NORMAL_READ); if (preg_match("/interface\b/", $read)) { $interface[] = $read; } if (preg_match("/neighbour\b/", $read)) { $neighbour[] = $read; } @@ -50,6 +107,25 @@ if (preg_match("/ok/", $read)){ break 1; } } socket_close($sock); +*/ + $file_handle = fopen($file, 'r'); + $set=0; + $i=0; + while (1) { + $line = fgets($file_handle); + if ($i <= 5) { + $data[] = $line; + $i++; + } + if (preg_match("/interface\b/", $line)) { $interface[] = $line; } + if (preg_match("/neighbour\b/", $line)) { $neighbour[] = $line; } + if (preg_match("/xroute\b/", $line)) { $xroute[] = $line; } + #if (preg_match("/\broute\b/", $read)){ break 1; } + if (preg_match("/\broute\b/", $line)){ $route[] = $line; } + if (preg_match("/ok/", $line)){ $set++; } + if ($set == 2) { break; } + } + fclose($file_handle); $output['data'] = array( 'name' => $data[0], @@ -119,6 +195,7 @@ +"; + echo shell_exec('ping '.$IP.' -c 3'); + echo "Traceroute $IP
"; + echo shell_exec('traceroute '.$IP.''); + echo ""; + } + } + } ?>