diff options
author | jim-p <jimp@pfsense.org> | 2011-09-21 14:04:56 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2011-09-21 14:04:56 -0400 |
commit | 2fdc826253202c2c093bd5f81cbba101d29bf25a (patch) | |
tree | e8dac5248a42743205a4d3f0aebb0baeab112571 | |
parent | dcd81322141d7a15ed771a559aef0e1680547fc9 (diff) | |
download | pfsense-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.php | 19 |
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} </td>\n"; echo "<td class=\"listr\">{$fspans}{$data['iaid']}{$fspane} </td>\n"; echo "<td class=\"listr\">{$fspans}{$data['duid']}{$fspane} </td>\n"; - echo "<td class=\"listr\">{$fspans}" . htmlentities($data['hostname']) . "{$fspane} </td>\n"; + echo "<td class=\"listr\">{$fspans}"; + if (!empty($data['hostname'])) { + echo htmlentities($data['hostname']) . "<br/>"; + } + echo htmlentities($arpdata[$data['ip']]['mac']); + echo "{$fspane} </td>\n"; if ($data['type'] != "static") { echo "<td class=\"listr\">{$fspans}" . adjust_gmt($data['start']) . "{$fspane} </td>\n"; echo "<td class=\"listr\">{$fspans}" . adjust_gmt($data['end']) . "{$fspane} </td>\n"; |