2008-01-16 08:36:45 +00:00
|
|
|
<?php
|
|
|
|
/*
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* (c) 2008 Monzoon Networks AG. All rights reserved.
|
|
|
|
*/
|
|
|
|
|
|
|
|
require_once('func.inc');
|
|
|
|
|
2010-08-02 11:23:42 +00:00
|
|
|
if (isset($_GET['n']))
|
2008-01-16 08:36:45 +00:00
|
|
|
$ntop = (int)$_GET['n'];
|
|
|
|
if ($ntop > 200)
|
|
|
|
$ntop = 200;
|
|
|
|
|
|
|
|
$topas = getasstats_top($ntop);
|
|
|
|
|
2014-03-12 14:05:29 +01:00
|
|
|
if (@$_GET['numhours']) {
|
|
|
|
$start = time() - $_GET['numhours']*3600;
|
|
|
|
$end = time();
|
|
|
|
} else {
|
|
|
|
$start = "";
|
|
|
|
$end = "";
|
|
|
|
}
|
|
|
|
|
2008-01-16 08:36:45 +00:00
|
|
|
?>
|
2008-02-19 15:43:28 +00:00
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2008-01-16 08:36:45 +00:00
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
2008-02-19 15:43:28 +00:00
|
|
|
<meta http-equiv="Refresh" content="300" />
|
2008-01-16 08:36:45 +00:00
|
|
|
<title>Top <?php echo $ntop; ?> AS</title>
|
|
|
|
<link rel="stylesheet" type="text/css" href="style.css" />
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<div id="nav">
|
2008-02-19 15:43:28 +00:00
|
|
|
<form action="" method="get">
|
2008-01-16 08:36:45 +00:00
|
|
|
Number of AS:
|
|
|
|
<input type="text" name="n" size="4" value="<?php echo $ntop; ?>" />
|
|
|
|
<input type="submit" value="Go" style="margin-right: 2em" />
|
2014-03-12 13:45:30 +01:00
|
|
|
<?php include('headermenu.inc'); ?>
|
|
|
|
</form>
|
2008-01-16 08:36:45 +00:00
|
|
|
</div>
|
|
|
|
<div class="pgtitle">Top <?php echo $ntop; ?> AS</div>
|
|
|
|
|
|
|
|
<table class="astable">
|
|
|
|
|
|
|
|
<?php $i = 0; foreach ($topas as $as => $nbytes):
|
|
|
|
$asinfo = getASInfo($as);
|
|
|
|
$class = (($i % 2) == 0) ? "even" : "odd";
|
|
|
|
?>
|
|
|
|
<tr class="<?php echo $class; ?>">
|
|
|
|
<th>
|
|
|
|
<div class="title">
|
|
|
|
<?php
|
2009-10-10 16:53:25 +00:00
|
|
|
$flagfile = "flags/" . strtolower($asinfo['country']) . ".gif";
|
2008-01-16 08:36:45 +00:00
|
|
|
if (file_exists($flagfile)):
|
|
|
|
$is = getimagesize($flagfile);
|
|
|
|
?>
|
|
|
|
<img src="<?php echo $flagfile; ?>" <?php echo $is[3]; ?>>
|
|
|
|
<?php endif; ?>
|
|
|
|
AS<?php echo $as; ?>: <?php echo $asinfo['descr']; ?>
|
|
|
|
</div>
|
2014-03-04 11:24:59 +11:00
|
|
|
<div class="small">IPv4: ~ <?php echo format_bytes($nbytes[0]); ?> in /
|
2008-01-16 08:36:45 +00:00
|
|
|
<?php echo format_bytes($nbytes[1]); ?> out in the last 24 hours</div>
|
2013-01-21 15:12:01 +00:00
|
|
|
<?php if ($showv6): ?>
|
2014-03-04 11:24:59 +11:00
|
|
|
<div class="small">IPv6: ~ <?php echo format_bytes($nbytes[2]); ?> in /
|
|
|
|
<?php echo format_bytes($nbytes[3]); ?> out in the last 24 hours</div>
|
2013-01-21 15:12:01 +00:00
|
|
|
<?php endif; ?>
|
2012-08-21 08:35:30 +00:00
|
|
|
|
|
|
|
<?php if (!empty($customlinks)): ?>
|
|
|
|
<div class="customlinks">
|
|
|
|
<?php
|
|
|
|
$htmllinks = array();
|
|
|
|
foreach ($customlinks as $linkname => $url) {
|
|
|
|
$url = str_replace("%as%", $as, $url);
|
|
|
|
$htmllinks[] = "<a href=\"$url\" target=\"_blank\">" . htmlspecialchars($linkname) . "</a>\n";
|
|
|
|
}
|
|
|
|
echo join(" | ", $htmllinks);
|
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
<?php endif; ?>
|
2008-01-16 08:36:45 +00:00
|
|
|
|
|
|
|
<div class="rank">
|
|
|
|
#<?php echo ($i+1); ?>
|
|
|
|
</div>
|
|
|
|
</th>
|
|
|
|
<td>
|
2013-01-21 15:12:01 +00:00
|
|
|
<?php if ($showv6): ?>
|
2014-06-17 17:33:50 +02:00
|
|
|
<a href="history.php?v=4&as=<?php echo $as; ?>" target="_blank"><img alt="AS graph" src="gengraph.php?as=<?php echo $as; ?>&width=<?php echo $top_graph_width ?>&height=<?php echo $top_graph_height ?>&v=4&nolegend=1&dname=<?php echo rawurlencode("AS" . $as . " - " . $asinfo['descr'] . " - IPV4"); ?>&start=<?php echo $start; ?>&end=<?php echo $end; ?>" width="<?php echo $top_graph_width ?>" height="<?php echo $top_graph_height ?>" border="0" /></a>
|
|
|
|
<a href="history.php?v=6&as=<?php echo $as; ?>" target="_blank"><img alt="AS graph" src="gengraph.php?as=<?php echo $as; ?>&width=<?php echo $top_graph_width ?>&height=<?php echo $top_graph_height ?>&v=6&nolegend=1&dname=<?php echo rawurlencode("AS" . $as . " - " . $asinfo['descr'] . " - IPV6"); ?>&start=<?php echo $start; ?>&end=<?php echo $end; ?>" width="<?php echo $top_graph_width ?>" height="<?php echo $top_graph_height ?>" border="0" /></a>
|
2013-01-21 15:12:01 +00:00
|
|
|
<?php else: ?>
|
2014-06-17 17:33:50 +02:00
|
|
|
<a href="history.php?as=<?php echo $as; ?>" target="_blank"><img alt="AS graph" src="gengraph.php?as=<?php echo $as; ?>&width=<?php echo $top_graph_width ?>&height=<?php echo $top_graph_height ?>&nolegend=1&dname=<?php echo rawurlencode("AS" . $as . " - " . $asinfo['descr'] . ""); ?>&start=<?php echo $start; ?>&end=<?php echo $end; ?>" width="<?php echo $top_graph_width ?>" height="<?php echo $top_graph_height ?>" border="0" /></a>
|
2013-01-21 15:12:01 +00:00
|
|
|
<?php endif; ?>
|
2008-01-16 08:36:45 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<?php $i++; endforeach; ?>
|
|
|
|
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<div id="legend">
|
|
|
|
<table>
|
|
|
|
<?php
|
|
|
|
$knownlinks = getknownlinks();
|
|
|
|
foreach ($knownlinks as $link) {
|
|
|
|
echo "<tr><td style=\"border: 4px solid #fff;\">";
|
|
|
|
|
|
|
|
echo "<table style=\"border-collapse: collapse; margin: 0; padding: 0\"><tr>";
|
2014-06-17 17:33:50 +02:00
|
|
|
if ($brighten_negative) {
|
2014-06-16 23:04:46 +02:00
|
|
|
echo "<td width=\"9\" height=\"18\" style=\"background-color: #{$link['color']}\"> </td>";
|
|
|
|
echo "<td width=\"9\" height=\"18\" style=\"opacity: 0.73; background-color: #{$link['color']}\"> </td>";
|
|
|
|
} else {
|
|
|
|
echo "<td width=\"18\" height=\"18\" style=\"background-color: #{$link['color']}\"> </td>";
|
|
|
|
}
|
2008-01-16 08:36:45 +00:00
|
|
|
echo "</tr></table>";
|
|
|
|
|
|
|
|
echo "</td><td> " . $link['descr'] . "</td></tr>\n";
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
|
2013-01-21 15:12:01 +00:00
|
|
|
<?php include('footer.inc'); ?>
|
2008-01-16 08:36:45 +00:00
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|