<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<link rel="stylesheet" href="index.css" type="text/css" />
<title>MAC/IP Address Tools</title>
<script language = "JavaScript">
function submitForm(url) {
document.theform.action = url;
document.theform.submit()
}
</script>
</head>
<?
include("paginator.php");
include("paginator_html.php");
include("config.php");
$db = mysql_connect($dbserver, $dbuser,$dbpasswd);
mysql_select_db($dbname,$db);
$bgcolor = array("#DDDDDD","#CCCCCC","#DD9999");
if(!isset($limits_per_page))
$limits_per_page = 20;
$links_per_page = 10;
?>
<body>
<div class="header">
<a href="http://www.lanifex.com"><img src="img/logo.jpg" alt=""></a>
</div>
<div class="menu">
<a href="index.html"><span>Home</span></a>
<a href="MACUpdate.php"><span>SNMP scan</span></a>
<a href="MACTools.php"><span>DB review</span></a>
<a href="switch_man.php"><span>Switch management</span></a>
</div>
<div class="content">
<?
function checkValidIP($ip)
{
if(!eregi("^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$", $ip))
$return = FALSE;
else $return = TRUE;
$tmp = explode(".", $ip);
if($return == TRUE){
foreach($tmp AS $sub){
$sub = $sub * 1;
if($sub<0 || $sub>256) $return = FALSE;
}
}
return $return;
}
if(!($_POST['submitMacValue'] || $_GET['submitMacValue']))
{
$error_msg = $_GET['error_msg'];
echo ("<h2>Database review</h2>");
echo("<p>From this page you can review the history of a specific MAC or IP address. You can also review the overall history,
the current MACs and IPs found on a particular switch and look at switch statistics.</p>\n<p>$error_msg</p>\n");
$stacksResult = mysql_query("SELECT ipaddress,dnsname FROM switches ORDER BY dnsname");
$switch_list = "";
while ($stacksrow = mysql_fetch_array($stacksResult))
{
$bsname = $stacksrow['dnsname'];
$ipaddress = $stacksrow['ipaddress'];
$switch_list .= "<OPTION value = '$ipaddress' >$bsname\n</option>";
}
echo "<div class=\"forms\">";
echo "<form method='post' action='MACTools.php'>";
echo "<fieldset>";
echo "<legend>MAC Address History</legend>";
echo "<p><label for=\"MACHistory\">MAC Address:</label> <input type=\"text\" name='MACHistory' id=\"MACHistory\" />";
echo "<input type='hidden' name='submitMacValue' value='5'>";
echo "<span class=\"submit\"><input type=\"submit\" value=\"Show\" /></span></p>";
echo "</fieldset>";
echo "</form> ";
echo "<form method='post' action='MACTools.php'>";
echo "<fieldset>";
echo "<legend>IP Address History</legend>";
echo "<p><label for=\"IPHistory\">IP Address: </label> <input type=\"text\" name='IPHistory' id=\"IPHistory\" />";
echo "<input type='hidden' name='submitMacValue' value='6'>";
echo "<span class=\"submit\"><input type=\"submit\" value=\"Show\" /></span></p>";
echo "</fieldset>";
echo "</form> ";
echo "<form method='post' action='MACTools.php'>";
echo "<fieldset>";
echo "<legend>Show Switches</legend>";
echo "<p><label for=\"switches\">Select switch:</label><select name='switches' id='switches'>$switch_list</select>";
echo "<input type='hidden' name='submitMacValue' value='7'>";
echo "<span class=\"submit\"><input type=\"submit\" value=\"Show\" /></span></p>";
echo "</fieldset>";
echo "</form> ";
echo "</div><div class=\"buttons\">";
echo "<form method='post' action='MACTools.php'>";
echo "<fieldset class=\"right\">";
echo "<legend>MAC History</legend>";
echo "<input type='hidden' name='submitMacValue' value='8'>";
echo "<p><label for=\"submit\">Show MAC History:</label><span class=\"submit\"><input type='Submit' name='submit' value='Show'></span></p>";
echo "</fieldset>";
echo "</form>";
echo "<form method='post' action='MACTools.php'>";
echo "<fieldset class=\"right\">";
echo "<legend>IP History</legend>";
echo "<input type='hidden' name='submitMacValue' value='9'>";
echo "<p><label for=\"submit\">Show IP History:</label><span class=\"submit\"><input type='Submit' name='submit' value='Show'></span></p>";
echo "</fieldset>";
echo "</form>";
echo "<form method='post' action='/portwatcher/MACSummary.php'>";
echo "<fieldset class=\"right\">";
echo "<legend>Switch Stats</legend>";
echo "<p><label for=\"submit\">Show Switch Stats:</label><span class=\"submit\"><input type='Submit' name='submit' value='Show'></span>";
echo "</fieldset>";
echo "</form>";
echo "</div>";
}
else
{
if ($_POST['submitMacValue'])
$submitMacValue = $_POST['submitMacValue'];
else
$submitMacValue = $_GET['submitMacValue'];
switch($submitMacValue)
{
case 5:
if ($_POST['MACHistory'])
$MACHistory = strtoupper(ereg_replace('[^a-fA-F0-9]+', "",$_POST['MACHistory']));
else
$MACHistory = strtoupper(ereg_replace('[^a-fA-F0-9]+', "",$_GET['MACHistory']));
if(strlen($MACHistory) != '12')
{
$error_msg = "<font color=red>MAC Address entered is incorrect</font>";
header("Location: MACTools.php?error_msg=$error_msg");
}
echo("<h3>Show MAC Address History from the Database</h3>");
flush();
ShowMACHistory($MACHistory);
break;
case 6:
if($_POST['IPHistory'])
$IPHistory = $_POST['IPHistory'];
else
$IPHistory = $_GET['IPHistory'];
if(!checkValidIP($IPHistory))
{
$error_msg = "<font color=red>IP Address entered is incorrect</font>";
header("Location: MACTools.php?error_msg=$error_msg");
}
echo("<h3>Show IP Address History from the Database</h3>");
flush();
ShowIPHistory($IPHistory);
break;
case 7:
echo("<h3>Show Switch Port</h3>");
if ($_POST['switches'])
$switches = $_POST['switches'];
else
$switches = $_GET['switches'];
ShowSwitch($switches);
break;
case 8:
echo("<h3>Show MAC History</h3>");
ShowAllMACHistory();
break;
case 9:
echo("<h3>Show IP History</h3>");
ShowAllIPHistory();
break;
}
flush();
}
mysql_close($db);
?>
<div class="clear"></div>
</div>
<div class="footer"></div>
</body>
</html>
<?
function getIPAddress($MAC)
{
$macipResult = mysql_query("SELECT ipaddress FROM macip where mac = \"$MAC\"");
$counter = 0;
if ($macipResult)
{
while ($maciprow = mysql_fetch_array($macipResult))
{
$dnsname = gethostbyaddr($maciprow[ipaddress]);
if($dnsname == $maciprow[ipaddress] )
$dnsname = "not in the DNS";
$BeginIPLink = "<a href=\"MACTools.php?IPHistory=$maciprow[ipaddress]&submitMacValue=6\">";
$EndIPLink = "</a>";
if($counter == 0)
$resultIPAddress = "$BeginIPLink$maciprow[ipaddress] [$dnsname]$EndIPLink";
else
$resultIPAddress .= " <br/>$BeginIPLink$maciprow[ipaddress] [$dnsname]$EndIPLink";
$counter++;
}
}
if(!$resultIPAddress)
{
unset($macipResult);
unset($maciprow);
$macipResult = mysql_query("SELECT ipaddress FROM maciphistory where mac = \"$MAC\"");
$resultIPAddress = "not in the Database";
if ($macipResult)
{
while ($maciprow = mysql_fetch_array($macipResult))
{
$dnsname = gethostbyaddr($maciprow[ipaddress]);
if($dnsname == $maciprow[ipaddress])
$dnsname = "not in the DNS";
$BeginIPLink = "<a href=\"MACTools.php?IPHistory=$maciprow[ipaddress]&submitMacValue=6\">";
$EndIPLink = "</a>";
if($counter == 0)
$resultIPAddress = "was used by: $BeginIPLink$maciprow[ipaddress] [$dnsname]$EndIPLink";
else
$resultIPAddress .= " <br/>$BeginIPLink$maciprow[ipaddress] [$dnsname]$EndIPLink";
$counter++;
}
}
}
return $resultIPAddress;
}
function ShowAllMACHistory()
{
global $limits_per_page,$links_per_page;
$bgcolor[0]="#f7e3bd";
$bgcolor[1]="#e9c88a";
$page = 1;
if ($_GET['page'])
$page = $_GET['page'];
if ($_POST['limits_per_page'])
$limits_per_page = $_POST['limits_per_page'];
$maxRowResult = mysql_query("SELECT count(*) FROM macporthistory");
$maxRow = mysql_result($maxRowResult,0);
$a =& new Paginator_html($page,$maxRow,$string);
$a->set_Limit($limits_per_page);
$a->set_Links($links_per_page);
$limit1 = $a->getRange1();
$limit2 = $a->getRange2();
@mysql_free_result($maxRowResult);
echo("<div class=\"center\">Total <strong>$maxRow</strong> records found.</div><br />\n");
$macporthistoryResult = mysql_query("SELECT * FROM macporthistory ORDER BY port LIMIT $limit1, $limit2");
if($maxRow != 0)
{
$links = $a->previousNext();
echo("<form name='theform' action='MACTools.php' method='post'>");
echo("<input type='hidden' name='submitMacValue' value='8'>");
echo("<div class=\"center\">Show <input type='text' size='3' name='limits_per_page' value='$limits_per_page'> records per page<br/>
$links ");
echo("<br/><span class=\"submit\"><input type='submit' value='Refresh' onClick=\"Javascript:submitForm('MACTools.php?page='+theform.page_f.value)\"></span></div><br/>");
}
echo("<table class=\"general\" cellspacing='0'><tr>");
echo "<td> No. \n";
echo "<td> Switch \n";
echo "<td> MAC \n";
echo "<td> Port \n";
echo "<td> Hostname \n";
echo "<td> Update Time \n";
echo("</tr>");
$index = $pos;
while ($macporthistoryrow = @mysql_fetch_array($macporthistoryResult))
{
$hostname = getIPAddress($macporthistoryrow[mac]);
$bsname = gethostbyaddr($macporthistoryrow[bsipaddress]);
$bgcolor_row = $bgcolor[($index++)%2];
echo("<tr bgcolor=$bgcolor_row>");
$macporthistorymac=$macporthistoryrow[mac];
$macporthistoryport = $macporthistoryrow[port];
$macporthistoryupdatetime = $macporthistoryrow[updatetime];
echo("<td align='right'> $index </td>");
echo("<td align='right'> <a href=\"MACTools.php?switches=$bsname&submitMacValue=7\">$bsname</a> </td>\n");
echo("<td align=right> <a href=\"MACTools.php?MACHistory=$macporthistorymac&submitMacValue=5\">$macporthistorymac</a> \n");
echo("</td>");
echo("<td align='right'> $macporthistoryport </td>\n");
echo("<td align='right'> $hostname </td>\n");
echo("<td align='right'> $macporthistoryupdatetime </td>\n");
echo("</tr>\n");
flush();
}
echo("</table>");
echo("</form>");
}
function ShowAllIPHistory()
{
global $limits_per_page,$links_per_page;
$bgcolor[0]="#f7e3bd";
$bgcolor[1]="#e9c88a";
$page = 1;
if ($_GET['page'])
$page = $_GET['page'];
if ($_POST['limits_per_page'])
$limits_per_page = $_POST['limits_per_page'];
$maxRowResult = mysql_query("SELECT * FROM maciphistory");
$maxRow = @mysql_num_rows($maxRowResult);
$a =& new Paginator_html($page,$maxRow,$string);
$a->set_Limit($limits_per_page);
$a->set_Links($links_per_page);
$limit1 = $a->getRange1();
$limit2 = $a->getRange2();
@mysql_free_result($maxRowResult);
echo("<center>Total $maxRow records.</center><BR>");
if($maxRow!=0)
{
$links = $a->previousNext();
echo("<form name='theform' action='MACTools.php' method='post'>");
echo("<input type='hidden' name='submitMacValue' value='9'>");
echo("<div class=\"center\">Show <input type='text' size='3' name='limits_per_page' value='$limits_per_page'> records per page<br/>
$links ");
echo("<br/><span class=\"submit\"><input type='submit' value='Refresh' onClick=\"Javascript:submitForm('MACTools.php?page='+theform.page_f.value)\"></span></div><br/>");
}
echo "<table class=\"general\" CELLSPACING=\"0\">";
echo "<tr>\n";
echo "<td> No. \n";
echo "<td> IP \n";
echo "<td> Hostname \n";
echo "<td> DNS \n";
echo "<td> MAC \n";
echo "<td> Switch \n";
echo "<td> Port \n";
echo "<td> Update Time \n";
echo "</tr>\n";
$maciphistoryResult = mysql_query("SELECT maciphistory.histid,maciphistory.ipaddress as maciphistoryipaddress,
maciphistory.mac,maciphistory.updatetime,macip.ipaddress,macip.sortipaddress,macip.dns
FROM maciphistory,macip where maciphistory.ipaddress = macip.ipaddress ORDER BY maciphistory.ipaddress LIMIT $limit1, $limit2");
$index = $pos;
if($maciphistoryResult)
{
while ($maciphistoryrow = mysql_fetch_array($maciphistoryResult))
{
$hostname = gethostbyaddr($maciphistoryrow[maciphistory.ipaddress]);
if($hostname == $maciphistoryrow[maciphistoryipaddress] )
$hostname = "Not in the DNS";
$macportResult = mysql_query("SELECT bsipaddress, port FROM macport where mac = \"$maciphistoryrow[mac]\" ");
if($macportResult)
{
$temp_res = mysql_fetch_array($macportResult);
$bsname = $temp_res['bsipaddress'];
$port = $temp_res['port'];
}
else
{
$bsname = $bsip;
$port = 0;
}
$bgcolor_row = $bgcolor[($index++)%2];
echo("<tr bgcolor=$bgcolor_row>");
$maciphistoryipaddress = $maciphistoryrow[maciphistoryipaddress];
echo("<td align=right> $index </td><td align=right> $maciphistoryipaddress </td>\n");
$maciphistorydns = (($maciphistoryrow[dns]==1)? "Yes":"No");
echo("<td align=right> $hostname </td><td align=right> $maciphistorydns </td>\n");
$maciphistorymac = $maciphistoryrow[mac];
$mod = $maciphistoryrow[module];
echo("<td align=right> <a href=\"MACTools.php?MACHistory=$maciphistorymac&submitMacValue=5\">$maciphistorymac</a> </td>\n");
echo("<td align=right> <a href=\"MACTools.php?switches=$bsname&submitMacValue=7\">$bsname</a> </td>\n");
echo("<td align=right> $port </td>\n");
$maciphistoryupdatetime = $maciphistoryrow[updatetime];
echo("<td align=right> $maciphistoryupdatetime </td>\n");
echo("</tr>\n");
flush();
}
}
echo "</table>";
echo("</form>");
}
function ShowMACHistory($MAC)
{
$bgcolor[0]="#f7e3bd";
$bgcolor[1]="#e9c88a";
echo "<table class=\"general\" CELLSPACING=\"0\">";
echo "<tr>\n";
echo "<td> No. \n";
echo "<td> MAC \n";
echo "<td> IP \n";
echo "<td> Switch \n";
echo "<td> Port \n";
echo "<td> Update Time \n";
echo "</tr>\n";
$macportResult = mysql_query("SELECT * FROM macport where mac like \"$MAC\" ORDER BY portindex");
$index = 0;
while ($macportrow = mysql_fetch_array($macportResult))
{
$macporthistoryResult = mysql_query("SELECT * FROM macporthistory where mac like \"$macportrow[mac]\" ORDER BY histid");
$dnsname = getIPAddress($macportrow[mac]);
unset($changed);
while ($macporthistoryrow = mysql_fetch_array($macporthistoryResult))
{
$bsname = $macporthistoryrow[bsipaddress];
if($macporthistoryrow[updatetime] == $macportrow[updatetime])
break;
$bgcolor_row = $bgcolor[($index++)%2];
echo("<tr bgcolor=$bgcolor_row>");
$date_change = $index;
$macporthistorymac = $macporthistoryrow[mac];
echo("<td align=right> $date_change </td>\n<td align=right> $macporthistorymac </td>\n");
echo("<td align=right> $dnsname </td>\n");
echo("<td align=right> <a href=\"MACTools.php?switches=$bsname&submitMacValue=7\">$bsname</a> </td>\n");
$macporthistoryport = $macporthistoryrow[port];
echo("<td align=right> $macporthistoryport </td>\n");
$macporthistoryportupdatetime = $macporthistoryrow[updatetime];
echo("<td align=right> $macporthistoryportupdatetime </td>\n");
echo("</tr>\n");
}
$hostname = gethostbyaddr($macportrow['bsipaddress']);
if ($hostname)
{
$bsname = $hostname;
}
else
{
$bsname = $macportrow['bsipaddress'];
}
$bgcolor_row = $bgcolor[($index++)%2];
echo("<tr bgcolor=$bgcolor_row>");
$date_change = $index;
$macportmac = $macportrow[mac];
echo("<td align=right> $date_change </td><td align=right> $macportmac </td>\n");
echo("<td align=right> $dnsname </td>\n");
echo("<td align=right> <a href=\"MACTools.php?switches=$bsname&submitMacValue=7\">$bsname</a> </td>\n");
$macportport = $macportrow[port];
echo("<td align=right> $macportport </td>\n");
$macportupdatetime = $macportrow[updatetime];
echo("<td align=right> $macportupdatetime </td>\n");
echo("</tr>\n");
flush();
}
echo("</table>");
}
function ShowIPHistory($IP)
{
$bgcolor[0]="#f7e3bd";
$bgcolor[1]="#e9c88a";
echo "<table class=\"general\" CELLSPACING=\"0\">";
echo "<tr>\n";
echo "<td> No. \n";
echo "<td> IP \n";
echo "<td> Name \n";
echo "<td> MAC \n";
echo "<td> Switch \n";
echo "<td> VLAN \n";
echo "<td> Port \n";
echo "<td> Update Time \n";
echo "</tr>\n";
if(ereg("[a-zA-Z]",$IP))
$IP = gethostbyname($IP);
$index = 0;
$macipResult = mysql_query("SELECT * FROM macip where ipaddress like \"$IP\"");
while ($maciprow = mysql_fetch_array($macipResult))
{
$maciphistoryResult = mysql_query("SELECT * FROM maciphistory where ipaddress = \"$maciprow[ipaddress]\"");
unset($changed);
while ($maciphistoryrow = mysql_fetch_array($maciphistoryResult))
{
if(($maciphistoryrow[updatetime] == $maciprow[updatetime]) && ($maciphistoryrow[mac] == $maciprow[mac]))
break;
$macportResult = mysql_query("SELECT bsipaddress, port FROM macport where mac = \"$maciphistoryrow[mac]\" ");
if($macportResult)
{
$temp_res = mysql_fetch_array($macportResult);
$bsname = $temp_res['bsipaddress'];
$port = $temp_res['port'];
}
else
{
$bsname = $bsip;
$port = 0;
}
$bgcolor_row = $bgcolor[($index++)%2];
echo("<tr bgcolor=$bgcolor_row>");
$dnsname = gethostbyaddr($maciphistoryrow[ipaddress]);
if($dnsname == $maciphistoryrow[ipaddress] )
$dnsname = "Not in the DNS";
$maciphistoryipaddress = $maciphistoryrow[ipaddress];
echo("<td align=right> $index </td><td align=right> $maciphistoryipaddress </td>\n");
echo("<td align=right> $dnsname </td>\n");
$maciphistorymac=$maciphistoryrow[mac];
$maciphistorymod=$maciphistoryrow[module];
echo("<td align=right> <a href=\"MACTools.php?MACHistory=$maciphistorymac&submitMacValue=5\">$maciphistorymac</a> </td>\n");
echo("<td align=right> <a href=\"MACTools.php?switches=$bsname&submitMacValue=7\">$bsname</a> </td>\n");
echo("<td align=right> $unit </td>\n<td align=right> $port </td>\n");
$maciphistoryupdatetime = $maciphistoryrow[updatetime];
echo("<td align=right> $maciphistoryupdatetime </td>\n");
echo("</tr>\n");
}
///////////////////////////////////////////////////////////////////////////////////////
$macportResult = mysql_query("SELECT bsipaddress, port FROM macport where mac = \"$maciprow[mac]\" ");
if($macportResult)
{
$temp_res = mysql_fetch_array($macportResult);
$bsname = $temp_res['bsipaddress'];
$port = $temp_res['port'];
}
else
{
$bsname = $bsip;
$port = 0;
}
///////////////////////////////////////////////////////////////////////////////////////
$dnsname = gethostbyaddr($maciprow[ipaddress]);
if($dnsname == $maciprow[ipaddress] )
$dnsname = "Not in the DNS";
$bgcolor_row = $bgcolor[($index++)%2];
echo("<tr bgcolor=$bgcolor_row>");
$macipipaddress = $maciprow[ipaddress];
echo("<td align=right> $index.$changed </td><td align=right> $macipipaddress </td>\n");
echo("<td align=right> $dnsname </td>\n");
$macipmac = $maciprow[mac];
$macipmod = $maciprow[module];
echo("<td align=right> <A HREF=\"MACTools.php?MACHistory=$macipmac&submitMacValue=5\">$macipmac</A> </td>\n");
echo("<td align=right> <A HREF=\"MACTools.php?switches=$bsname&submitMacValue=7\">$bsname</A> </td>\n");
echo("<td align=right> $unit </td><td align=right> $port </td>\n");
$macipupdatetime = $maciprow[updatetime];
echo("<td align=right> $macipupdatetime </td>\n");
echo("</tr>\n");
flush();
}
echo"</table>";
}
function ShowSwitch ($IP)
{
global $limits_per_page,$links_per_page;
$bgcolor[0]="#f7e3bd";
$bgcolor[1]="#e9c88a";
$page = 1;
if ($_GET['page'])
$page = $_GET['page'];
if ($_POST['limits_per_page'])
$limits_per_page = $_POST['limits_per_page'];
$bsip = gethostbyname($IP);
$maxRowResult = mysql_query("SELECT count(*) FROM macport where bsipaddress = \"$bsip\" ORDER BY bsipaddress, port");
$maxRow = mysql_result($maxRowResult,0);
$a =& new Paginator_html($page,$maxRow,$string);
$a->set_Limit($limits_per_page);
$a->set_Links($links_per_page);
$limit1 = $a->getRange1();
$limit2 = $a->getRange2();
@mysql_free_result($maxRowResult);
echo("<div class=\"center\">Total <strong>$maxRow</strong> records found.</div><br/>");
$macportResult =mysql_query("SELECT * FROM macport where bsipaddress = \"$bsip\" ORDER BY bsipaddress,port LIMIT $limit1, $limit2");
$index = 0;
if($maxRow!=0)
{
$links = $a->previousNext();
echo("<form name='theform' action='./MACTools.php' method='post'>");
echo("<input type='hidden' name='submitMacValue' value='7'>");
echo("<input type='hidden' name='switches' value='$IP'>");
echo("<div class=\"center\">Show <input type='text' size='3' name='limits_per_page' value='$limits_per_page'> records per page<br/>
$links ");
echo("<br/><span class=\"submit\"><input type='submit' value='Refresh' onClick=\"Javascript:submitForm('MACTools.php?page='+theform.page_f.value)\" ></span></div><br/>");
}
echo "<table class=\"general\" CELLSPACING=\"0\">";
echo "<tr>\n";
echo "<td> No. \n";
echo "<td> Switch \n";
echo "<td> Port \n";
echo "<td> MAC \n";
echo "<td> IP \n";
echo "<td> Update Time \n";
echo "</tr>\n";
while ($macportrow = mysql_fetch_array($macportResult))
{
$bsname = gethostbyaddr($macportrow['bsipaddress']);
if (strlen($bsname) < 2)
$bsname = $macportrow['bsipaddress'];
$bgcolor_row = $bgcolor[($index++)%2];
echo("<tr bgcolor=$bgcolor_row>");
echo("<td align=right> $index </td><td align=right> $bsname </td>\n");
$dnsname = getIPAddress($macportrow[mac]);
$macportunit = $macportrow[unit];
$macportport = $macportrow[port];
$macportmod = $macportrow[module];
echo("<td align=right> $macportport </td>\n");
$macportmac = $macportrow[mac];
echo("<td align=right> <a href=\"MACTools.php?MACHistory=$macportmac&submitMacValue=5\">$macportmac</a> \n");
echo("</td>");
echo("<td> $dnsname ");
if ($dnsname != 'not in the Database')
{
$ipaddress = eregi_replace(" \[.*","",$dnsname);
$ipaddress = eregi_replace(".*>","",$ipaddress);
echo("<a href='/dmo_new/index/data/qsrchres?srch=" . $ipaddress . "&dosrch=Go&qsel=2&qsaID=0'><img border='0' src='/LFXlib/images/magnifier.gif' alt='DMO Search'></a></td>\n");
}
else
{
echo("</td>");
}
$macportstatus = $macportrow[status];
$macportupdatetime = $macportrow[updatetime];
echo("<td align=right> $macportupdatetime </td>\n");
echo("</tr>\n");
}
echo "</table>\n";
echo("</form>");
flush();
}
?>