diff --git a/DATABASE-CHANGES b/DATABASE-CHANGES
new file mode 100644
index 000000000..3f5030d39
--- /dev/null
+++ b/DATABASE-CHANGES
@@ -0,0 +1,2 @@
+Since 0.6.0
+ interfaces table added field `ifName` VARCHAR(64)
diff --git a/html/pages/device/ports.inc.php b/html/pages/device/ports.inc.php
index 4bbf0ca19..bea93b73d 100644
--- a/html/pages/device/ports.inc.php
+++ b/html/pages/device/ports.inc.php
@@ -64,7 +64,8 @@ if($_GET['optc'] == thumbs) {
if($_GET['opta'] == "arp" ) {
$interface_query = mysql_query("select * from interfaces WHERE device_id = '$_GET[id]' AND deleted = '0' ORDER BY `ifIndex` ASC");
- echo("
| Address | Hardware Addr | Interface | Remote Device | Remote Port |
");
+ echo("| Address | Hardware Addr | Interface | Remote Device | Remote Port |
+ Rate Up | Rate Down |
");
$i = 1;
while($interface = mysql_fetch_array($interface_query)) {
$sql = "SELECT * FROM `ipv4_mac` WHERE `interface_id` = '".$interface['interface_id']."'";
@@ -76,15 +77,32 @@ if($_GET['optc'] == thumbs) {
I.device_id = D.device_id AND A.ipv4_address = '".$arp['ipv4_address']."' ORDER BY A.ipv4_address";
$remote = mysql_fetch_array(mysql_query($r_sql));
$mac = formatMac($arp['mac_address']);
+ $mac_acc = mysql_fetch_array(mysql_query("SELECT * FROM mac_accounting WHERE `interface_id` = '".$interface['interface_id']."' AND mac = '".$arp['mac_address']."'"));
echo("
| " . $arp['ipv4_address'] . " | " . $mac . " | ".generateiflink($interface)." | ");
if ($remote['interface_id'] == $interface['interface_id']) {
- echo("local | local | ");
+ $remote_host = "local";
+ $remote_port = "local";
} elseif($remote['device_id']) {
- echo("" . generatedevicelink($remote) . " | " . generateiflink($remote) . " | ");
+ $remote_host = generatedevicelink($remote);
+ $remote_port = generateiflink($remote);
+ } elseif(mysql_result(mysql_query("SELECT count(*) FROM bgpPeers WHERE device_id = '".$device['device_id']."' AND bgpPeerIdentifier ='".$arp['ipv4_address']."'"),0)) {
+ $peer_query = mysql_query("SELECT * FROM bgpPeers WHERE device_id = '".$device['device_id']."' AND bgpPeerIdentifier = '".$arp['ipv4_address']."'");
+ $peer_info = mysql_fetch_array($peer_query);
+ $remote_host = "AS".$peer_info['bgpPeerRemoteAs'];
+ $remote_port = truncate($peer_info['astext'], 24);
+ } else {
+ $remote_host = "";
+ $remote_port = "";
+ }
+ echo("$remote_host | $remote_port | ");
+
+ if ($mac_acc['interface_id'] == $interface['interface_id']) {
+ echo("".formatRates($mac_acc['bps_out'])." | ".formatRates($mac_acc['bps_in'])." | ");
} else {
echo(" | | ");
}
+
echo("
");
}
echo("");