From 9e3cb876a600087c8fb2fa0af7907b986e304c48 Mon Sep 17 00:00:00 2001 From: jim-p Date: Wed, 28 Sep 2016 12:10:39 -0400 Subject: [PATCH] Improve the ARP table display. Implements #6822 Shows incomplete ARP entries, which were skipped before (for no reason I could find in the commit history) Shows a status column indicating if an entry is permanent (static), expired, or when it will expire Shows a Link Type column that indicates if an entry is using Ethernet, VLAN, etc. --- src/usr/local/www/diag_arp.php | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/usr/local/www/diag_arp.php b/src/usr/local/www/diag_arp.php index 4d13b0d28f..717e8c1bfb 100644 --- a/src/usr/local/www/diag_arp.php +++ b/src/usr/local/www/diag_arp.php @@ -238,15 +238,14 @@ foreach ($ifdescrs as $key => $interface) { $data = array(); foreach ($rawdata as $line) { - $elements = explode(' ', $line); - - if ($elements[3] != "(incomplete)") { - $arpent = array(); - $arpent['ip'] = trim(str_replace(array('(', ')'), '', $elements[1])); - $arpent['mac'] = trim($elements[3]); - $arpent['interface'] = trim($elements[5]); - $data[] = $arpent; - } + $elements = explode(' ', $line, 7); + $arpent = array(); + $arpent['ip'] = trim(str_replace(array('(', ')'), '', $elements[1])); + $arpent['mac'] = trim($elements[3]); + $arpent['interface'] = trim($elements[5]); + $arpent['status'] = trim(substr($elements[6], 0, strrpos($elements[6], ' '))); + $arpent['linktype'] = trim(str_replace(array('[', ']'), '', strrchr($elements[6], ' '))); + $data[] = $arpent; } function _getHostName($mac, $ip) { @@ -334,6 +333,8 @@ $mac_man = load_mac_manufacturer_table(); + + @@ -356,6 +357,8 @@ $mac_man = load_mac_manufacturer_table(); ?> + + @@ -379,7 +382,10 @@ events.push(function() {
' . gettext("NDP") . '' . gettext(" instead of ARP."), 'info', false); +print_info_box(gettext("Local IPv6 peers use ") . '' . gettext("NDP") . '' . gettext(" instead of ARP.") . '
' . + '
' . gettext("Permanent ARP entries are shown for local interfaces or static ARP entries.") . + '
' . gettext("Normal dynamic ARP entries show a countdown timer until they will expire and then be re-checked.") . + '
' . gettext("Incomplete ARP entries indicate that the target host has not yet replied to an ARP response."), 'info', false); ?>