summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2011-09-21 14:04:56 -0400
committerjim-p <jimp@pfsense.org>2011-09-21 14:04:56 -0400
commit2fdc826253202c2c093bd5f81cbba101d29bf25a (patch)
treee8dac5248a42743205a4d3f0aebb0baeab112571
parentdcd81322141d7a15ed771a559aef0e1680547fc9 (diff)
downloadpfsense-2fdc826253202c2c093bd5f81cbba101d29bf25a.zip
pfsense-2fdc826253202c2c093bd5f81cbba101d29bf25a.tar.gz
Show MAC address on DHCPv6 output. (Not that it's used in the same way for DHCPv6 as it is for v4, but it's handy to see in one place)
-rw-r--r--usr/local/www/status_dhcpv6_leases.php19
1 files changed, 12 insertions, 7 deletions
diff --git a/usr/local/www/status_dhcpv6_leases.php b/usr/local/www/status_dhcpv6_leases.php
index 5208f73..76358e3 100644
--- a/usr/local/www/status_dhcpv6_leases.php
+++ b/usr/local/www/status_dhcpv6_leases.php
@@ -145,10 +145,10 @@ foreach ($rawdata as $line) {
$elements = preg_split('/\s+/ ',$line);
if ($elements[1] != "(incomplete)") {
$arpent = array();
- $arpent['ip'] = trim(str_replace(array('(',')'),'',$elements[0]));
- // $arpent['mac'] = trim($elements[3]);
- // $arpent['interface'] = trim($elements[5]);
- $arpdata[] = $arpent['ip'];
+ $ip = trim(str_replace(array('(',')'),'',$elements[0]));
+ $arpent['mac'] = trim($elements[1]);
+ $arpent['interface'] = trim($elements[2]);
+ $arpdata[$ip] = $arpent;
}
}
@@ -209,7 +209,7 @@ while($i < $leases_count) {
break;
case "iaaddr":
$leases[$l]['ip'] = $data[$f+1];
- if (in_array($leases[$l]['ip'], $arpdata)) {
+ if (in_array($leases[$l]['ip'], array_keys($arpdata))) {
$leases[$l]['online'] = 'online';
} else {
$leases[$l]['online'] = 'offline';
@@ -358,7 +358,7 @@ foreach ($pools as $data) {
<td class="listhdrr"><a href="#"><?=gettext("IPv6 address"); ?></a></td>
<td class="listhdrr"><a href="#"><?=gettext("IAID"); ?></a></td>
<td class="listhdrr"><a href="#"><?=gettext("DUID"); ?></a></td>
- <td class="listhdrr"><a href="#"><?=gettext("Hostname"); ?></a></td>
+ <td class="listhdrr"><a href="#"><?=gettext("Hostname/MAC"); ?></a></td>
<td class="listhdrr"><a href="#"><?=gettext("Start"); ?></a></td>
<td class="listhdrr"><a href="#"><?=gettext("End"); ?></a></td>
<td class="listhdrr"><a href="#"><?=gettext("Online"); ?></a></td>
@@ -400,7 +400,12 @@ foreach ($leases as $data) {
echo "<td class=\"listlr\">{$fspans}{$data['ip']}{$fspane}&nbsp;</td>\n";
echo "<td class=\"listr\">{$fspans}{$data['iaid']}{$fspane}&nbsp;</td>\n";
echo "<td class=\"listr\">{$fspans}{$data['duid']}{$fspane}&nbsp;</td>\n";
- echo "<td class=\"listr\">{$fspans}" . htmlentities($data['hostname']) . "{$fspane}&nbsp;</td>\n";
+ echo "<td class=\"listr\">{$fspans}";
+ if (!empty($data['hostname'])) {
+ echo htmlentities($data['hostname']) . "<br/>";
+ }
+ echo htmlentities($arpdata[$data['ip']]['mac']);
+ echo "{$fspane}&nbsp;</td>\n";
if ($data['type'] != "static") {
echo "<td class=\"listr\">{$fspans}" . adjust_gmt($data['start']) . "{$fspane}&nbsp;</td>\n";
echo "<td class=\"listr\">{$fspans}" . adjust_gmt($data['end']) . "{$fspane}&nbsp;</td>\n";
OpenPOWER on IntegriCloud