= "10000000000") { $info = "color=lightred style=\"setlinewidth(8)\""; } elseif ($link['ifSpeed'] >= "1000000000") { $info = "color=lightblue style=\"setlinewidth(4)\""; } elseif ($link['ifSpeed'] >= "100000000") { $info = "color=lightgrey style=\"setlinewidth(2)\""; } elseif ($link['ifSpeed'] >= "10000000") { $info = "style=\"setlinewidth(1)\""; } else { $info = "style=\"setlinewidth(1)\""; } $src = $device['hostname']; $dst = mysql_result(mysql_query("SELECT `hostname` FROM `devices` AS D, `interfaces` AS I WHERE I.interface_id = '$dst_if' AND D.device_id = I.device_id"),0); $dst_host = mysql_result(mysql_query("SELECT D.device_id FROM `devices` AS D, `interfaces` AS I WHERE I.interface_id = '$dst_if' AND D.device_id = I.device_id"),0); $sif = ifNameDescr(mysql_fetch_array(mysql_query("SELECT * FROM interfaces WHERE `interface_id`=" . $link['src_if'])),$device); $dif = ifNameDescr(mysql_fetch_array(mysql_query("SELECT * FROM interfaces WHERE `interface_id`=" . $link['dst_if']))); $map .= "\"" . $sif['interface_id'] . "\" [label=\"" . $sif['label'] . "\", fontsize=12, fillcolor=lightblue URL=\"/device/".$device['device_id']."/interface/$src_if/\"]\n"; $map .= "\"$src\" -> \"" . $sif['interface_id'] . "\" [weight=500000, arrowsize=0, len=0];\n"; $map .= "\"$dst\" [URL=\"/device/$dst_host/map/\" fontsize=20 shape=box3d]\n"; if($dst_host == $device['device_id']) { $map .= "\"" . $dif['interface_id'] . "\" [label=\"" . $dif['label'] . "\", fontsize=12, fillcolor=lightblue, URL=\"/device/$dst_host/interface/$dst_if/\"]\n"; } else { $map .= "\"" . $dif['interface_id'] . "\" [label=\"" . $dif['label'] . " \", fontsize=12, fillcolor=lightgray, URL=\"/device/$dst_host/interface/$dst_if/\"]\n"; } $map .= "\"" . $dif['interface_id'] . "\" -> \"$dst\" [weight=500000, arrowsize=0, len=0];\n"; $map .= "\"" . $sif['interface_id'] . "\" -> \"" . $dif['interface_id'] . "\" [weight=1, arrowhead=normal, arrowtail=normal, len=2, $info] \n"; } } $map .= " };"; if ($_GET['debug'] == 1) { echo("
$map
");exit(); } $img = shell_exec("echo \"".addslashes($map)."\" | dot -T".$_GET['format'].""); if($_GET['format'] == "png") { header("Content-type: image/".$_GET['format']); } elseif ($_GET['format'] == "svg") { header("Content-type: image/svg+xml"); $img = str_replace("