43 lines
1.3 KiB
PHP
43 lines
1.3 KiB
PHP
<?php
|
|
require_once "load-networks.php";
|
|
require_once "load-hosts.php";
|
|
|
|
$network = $networks[$tag];
|
|
?>
|
|
<html>
|
|
<head>
|
|
<style>
|
|
table {
|
|
border-collapse: collapse;
|
|
}
|
|
th, td {
|
|
border: 1px solid;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h1>
|
|
<?=$tag?><br/>
|
|
<small><?=long2ip($network["network-addr"])?>/<?=$network["cidr_mask"]?></small>
|
|
</h1>
|
|
<table>
|
|
<tbody>
|
|
<tr><th></th><th>Adresse IP</th><th>Adresse MAC</th><th>Nom d'hôte</th><th>Description</th><th>Services</th><th></th></tr>
|
|
<?php
|
|
for ($ipaddr = $network["network-addr"] + 1; $ipaddr < $network["broadcast"]; $ipaddr++):
|
|
$host = $hosts[$ipaddr] ?? [];
|
|
?>
|
|
<tr>
|
|
<td></td>
|
|
<td><?=long2ip($ipaddr)?></td>
|
|
<td><?=implode("<br/>\n", $host["hwaddrs"] ?? [])?></td>
|
|
<td><?=implode("<br/>\n", $host["hostnames"] ?? [])?></td>
|
|
<td><?=$host["comment"] ?? "" ?></td>
|
|
<td><?=implode(", ", $host["services"] ?? [])?></td>
|
|
<td></td>
|
|
</tr>
|
|
<?php endfor; ?>
|
|
</tbody>
|
|
</table>
|
|
</body>
|
|
</html>
|