summaryrefslogtreecommitdiffstats
path: root/usr/local/www/diag_arp.php
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2009-09-11 16:16:20 -0400
committerScott Ullrich <sullrich@pfsense.org>2009-09-11 16:16:20 -0400
commit4a993c8f9c1a161800ff513b7d0f7b83f6bde250 (patch)
tree9925a48133bc109b361e30e35315639f99979d6b /usr/local/www/diag_arp.php
parent53d4b84d21f099ef9126c9708ff5014b6ef46b12 (diff)
downloadpfsense-4a993c8f9c1a161800ff513b7d0f7b83f6bde250.zip
pfsense-4a993c8f9c1a161800ff513b7d0f7b83f6bde250.tar.gz
Sort ARP table. Sort items with hostnames first then list items without hostnames afterwards.
Diffstat (limited to 'usr/local/www/diag_arp.php')
-rwxr-xr-xusr/local/www/diag_arp.php36
1 files changed, 33 insertions, 3 deletions
diff --git a/usr/local/www/diag_arp.php b/usr/local/www/diag_arp.php
index 4b07f8b..1272f5e 100755
--- a/usr/local/www/diag_arp.php
+++ b/usr/local/www/diag_arp.php
@@ -233,14 +233,36 @@ function getHostName($mac,$ip)
else if(gethostbyaddr($ip) <> "" and gethostbyaddr($ip) <> $ip)
return gethostbyaddr($ip);
else
- return "&nbsp;";
+ return "";
}
$pgtitle = array("Diagnostics","ARP Table");
include("head.inc");
?>
<body link="#000000" vlink="#000000" alink="#000000">
-<? include("fbegin.inc"); ?>
+
+<?php
+ include("fbegin.inc");
+?>
+
+<div id="loading">
+ <img src="/themes/metallic/images/misc/loader.gif"> Loading, please wait...
+ <p/>&nbsp;
+</div>
+
+<?php
+
+// Resolve hostnames
+foreach ($data as &$entry) {
+ $dns = trim(getHostName($entry['mac'], $entry['ip']));
+ if(trim($dns))
+ $entry['dnsresolve'] = "$dns";
+ else
+ $entry['dnsresolve'] = "Z_ ";
+}
+$data = msort($data, "dnsresolve");
+
+?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
@@ -256,7 +278,11 @@ include("head.inc");
<tr>
<td class="listlr"><?=$entry['ip'];?></td>
<td class="listr"><?=$entry['mac'];?></td>
- <td class="listr"><?=getHostName($entry['mac'], $entry['ip']);?></td>
+ <td class="listr">
+ <?php
+ echo str_replace("Z_ ", "", $entry['dnsresolve']);
+ ?>
+ </td>
<td class="listr"><?=$hwif[$entry['interface']];?></td>
</tr>
<?php endforeach; ?>
@@ -264,3 +290,7 @@ include("head.inc");
</td></tr></table>
<?php include("fend.inc"); ?>
+
+<script type="text/javascript">
+ $('loading').innerHTML = '';
+</script>
OpenPOWER on IntegriCloud