function uhw_FindMac($ip) { $uconf = uhw_LoadConfig(); $sudo_path = $uconf['SUDO_PATH']; $cat_path = $uconf['CAT_PATH']; $logpath = $uconf['LOG_PATH']; $tail_path = $uconf['TAIL_PATH']; $grep_path = $uconf['GREP_PATH']; $unknown_mask = $uconf['UNKNOWN_MASK']; $unknown_lease = $uconf['UNKNOWN_LEASE']; $raw = shell_exec($sudo_path . ' ' . $cat_path . ' ' . $logpath . ' | ' . $grep_path . ' "' . $unknown_lease . $ip . ' " | ' . $tail_path . ' -n1'); if (!empty($raw)) { $mac_detect = uhw_MacParse($raw); if ($mac_detect) { return $mac_detect; } else { return false; } } else { return false; } }
function uhw_FindOpt82($ip) { $uconf = uhw_LoadConfig(); $sudo_path = $uconf['SUDO_PATH']; $cat_path = $uconf['CAT_PATH']; $logpath = $uconf['LOG_PATH']; $tail_path = $uconf['TAIL_PATH']; $grep_path = $uconf['GREP_PATH']; $unknown_mask = $uconf['UNKNOWN_MASK']; $unknown_lease = $uconf['UNKNOWN_LEASE']; $raw = shell_exec($sudo_path . ' ' . $cat_path . ' ' . $logpath . ' | ' . $grep_path . ' "' . $unknown_lease . $ip . ' " | ' . $tail_path . ' -n1'); $opt82_detect = ''; if (!empty($raw)) { $explodeLine = explode(' ', $raw); //log have normal format if (isset($explodeLine[9]) and isset($explodeLine[11]) and isset($explodeLine[7])) { $leaseIp = $explodeLine[7]; $remoteId = $explodeLine[9]; $circuitID = $explodeLine[11]; //check for new lease? $opt82_detect = $remoteId . '+' . $circuitID; } if ($opt82_detect) { return $opt82_detect; } else { return false; } } else { return false; } }
<?php // Send main headers header('Last-Modified: ' . gmdate('r')); header('Content-Type: text/html; charset=utf-8'); header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1 header("Pragma: no-cache"); include "libs/api.mysql.php"; include "libs/api.uhw.php"; $uconf = uhw_LoadConfig(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title><?php echo $uconf['TITLE']; ?> </title> <link href="style.css" rel="stylesheet" type="text/css" media="screen" /> <link type="text/css" href="jui/css/smoothness/jquery-ui-1.8.23.custom.css" rel="stylesheet" /> <script type="text/javascript" src="jui/js/jquery-1.8.0.min.js"></script> <script type="text/javascript" src="jui/js/jquery-ui-1.8.23.custom.min.js"></script> </head> <body> <div id="wrapper"> <div id="header" class="container"> <div id="logo"> <h1><a href="<?php echo $uconf['ISP_URL'];