".$port_info['device_name']." [".$port_info['port']."]
\n"; $sw_auth=NULL; $sw_mac=NULL; if ($port_info['vendor_id'] == 9) { $sw_auth = get_record_sql($db_link,"SELECT mac FROM User_auth WHERE deleted=0 and ip='".$port_info['ip']."'"); $sw_mac = mac_simplify($sw_auth['mac']); $sw_mac = preg_replace("/.{2}$/","",$sw_mac); } $snmp_ok = 0; if (!empty($device['ip']) and $device['snmp_version'] > 0) { $snmp_ok = check_snmp_access($device['ip'], $snmp); } if ($snmp_ok and $port_info['snmp_index'] > 0) { print "\n"; print "\n"; $fdb = get_fdb_table($port_info['ip'], $snmp); $f_port = $port_info['snmp_index']; $port_by_snmp = 0; foreach ($fdb as $a_mac => $a_port) { if (!empty($ports_by_snmp_index[$a_port])) { $port_by_snmp=1; break; } } if (!$port_by_snmp) { $f_port = $port_info['port']; } foreach ($fdb as $a_mac => $a_port) { if ($a_port == $f_port) { $a_mac = dec_to_hex($a_mac); //mikrotik patch if (!empty($sw_mac) and preg_match('/^'.$sw_mac.'/',mac_simplify($a_mac))) { continue; } print ""; $auth = get_auth_by_mac($db_link, $a_mac); print "\n"; print ""; } } print "
".WEB_device_port_mac_table_show."
" .$auth['auth'] . "". $auth['mac']."
\n"; } else { print "No SNMP access!"; } unset_lock_discovery($db_link,$device_id); ?> ".WEB_device_port_mac_table_history."
\n"; $d_sql = "select A.ip,A.ip_int,A.mac,A.id,A.dns_name,A.last_found from User_auth as A, connections as C where C.port_id=$port_id and A.id=C.auth_id order by A.ip_int"; $t_device = mysqli_query($db_link, $d_sql); while (list ($f_ip, $f_int, $f_mac, $f_auth_id, $f_dns, $f_last) = mysqli_fetch_array($t_device)) { $name = $f_ip; if (isset($f_dns) and $f_dns != '') { $name = $f_dns; } print ""; print "\n"; print "\n"; print "\n"; print ""; } $maclist = mysqli_query($db_link, "SELECT mac,timestamp from Unknown_mac where port_id=$port_id order by timestamp desc"); while (list ($fmac, $f_last) = mysqli_fetch_array($maclist)) { print ""; print "\n"; print "\n"; print "\n"; print ""; } print "
" . expand_mac($db_link,$f_mac) . "" . $name . "$f_last
" . expand_mac($db_link,$fmac) . "Unknown$f_last
\n"; require_once($_SERVER['DOCUMENT_ROOT'] . "/inc/footer.simple.php"); ?>