From e5fe2fb0ecc8db40a2c80be7150b75fa9d13aa46 Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Sun, 24 Apr 2011 12:55:20 +0000 Subject: [PATCH] blah2.0 git-svn-id: http://www.observium.org/svn/observer/trunk@2159 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/pages/device/ports/arp.inc.php | 35 +++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 html/pages/device/ports/arp.inc.php diff --git a/html/pages/device/ports/arp.inc.php b/html/pages/device/ports/arp.inc.php new file mode 100644 index 0000000000..94fd427b28 --- /dev/null +++ b/html/pages/device/ports/arp.inc.php @@ -0,0 +1,35 @@ +'); + +$i = "1"; + +while ($arp = mysql_fetch_assoc($query)) +{ + if (!is_integer($i/2)) { $bg_colour = $list_colour_a; } else { $bg_colour = $list_colour_b; } + + $arp_host = mysql_fetch_assoc(mysql_query("SELECT * FROM ipv4_addresses AS A, ports AS I, devices AS D WHERE A.ipv4_address = '".$arp['ipv4_address']."' AND I.interface_id = A.interface_id AND D.device_id = I.device_id")); + + if ($arp_host) { $arp_name = generate_device_link($arp_host); } else { unset($arp_name); } + if ($arp_host) { $arp_if = generate_port_link($arp_host); } else { unset($arp_if); } + + if ($arp_host['device_id'] == $device['device_id']) { $arp_name = "Localhost"; } + if ($arp_host['interface_id'] == $arp['interface_id']) { $arp_if = "Local Port"; } + + echo(" + + ".generate_port_link(array_merge($arp, $device))." + ".formatmac($arp['mac_address'])." + ".$arp['ipv4_address']." + $arp_name + $arp_if + "); + $i++; +} + +echo(""); + +?>