summaryrefslogtreecommitdiffstats
path: root/src/usr/local/bin
diff options
context:
space:
mode:
authorheper <heper@users.noreply.github.com>2015-11-08 17:10:26 +0100
committerheper <heper@users.noreply.github.com>2015-11-08 17:10:26 +0100
commit56743bb16d63ac9b8ee1d4bc37e3125ea6347e55 (patch)
treec110893b755f4bc2097ff1a71eedc00768584df1 /src/usr/local/bin
parent18d316a5bb5b2e18f0cb9d4cbe72c92f5d945393 (diff)
downloadpfsense-56743bb16d63ac9b8ee1d4bc37e3125ea6347e55.zip
pfsense-56743bb16d63ac9b8ee1d4bc37e3125ea6347e55.tar.gz
remove useless arp data
Diffstat (limited to 'src/usr/local/bin')
-rw-r--r--src/usr/local/bin/dhcpd_gather_stats.php35
1 files changed, 0 insertions, 35 deletions
diff --git a/src/usr/local/bin/dhcpd_gather_stats.php b/src/usr/local/bin/dhcpd_gather_stats.php
index e2ebee0..21005b6 100644
--- a/src/usr/local/bin/dhcpd_gather_stats.php
+++ b/src/usr/local/bin/dhcpd_gather_stats.php
@@ -52,19 +52,6 @@ $splitpattern = "'BEGIN { RS=\"}\";} {for (i=1; i<=NF; i++) printf \"%s \", \$i;
/* stuff the leases file in a proper format into a array by line */
exec("/bin/cat {$leasesfile} | {$awk} {$cleanpattern} | {$awk} {$splitpattern}", $leases_content);
-$leases_count = count($leases_content);
-exec("/usr/sbin/arp -an", $rawdata);
-$arpdata_ip = array();
-$arpdata_mac = array();
-foreach ($rawdata as $line) {
- $elements = explode(' ', $line);
- if ($elements[3] != "(incomplete)") {
- $arpent = array();
- $arpdata_ip[] = trim(str_replace(array('(', ')'), '', $elements[1]));
- $arpdata_mac[] = strtolower(trim($elements[3]));
- }
-}
-unset($rawdata);
$pools = array();
$leases = array();
$i = 0;
@@ -155,27 +142,6 @@ foreach ($leases_content as $lease) {
/* skip the rewind binding statement */
$f = $f+3;
break;
- case "hardware":
- $leases[$l]['mac'] = $data[$f+2];
- /* check if it's online and the lease is active */
- if (in_array($leases[$l]['ip'], $arpdata_ip)) {
- $leases[$l]['online'] = 'online';
- } else {
- $leases[$l]['online'] = 'offline';
- }
- $f = $f+2;
- break;
- case "client-hostname":
- if ($data[$f+1] <> "") {
- $leases[$l]['hostname'] = preg_replace('/"/', '', $data[$f+1]);
- } else {
- $hostname = gethostbyaddr($leases[$l]['ip']);
- if ($hostname <> "") {
- $leases[$l]['hostname'] = $hostname;
- }
- }
- $f = $f+1;
- break;
case "uid":
$f = $f+1;
break;
@@ -208,7 +174,6 @@ foreach ($config['interfaces'] as $ifname => $ifarr) {
$slease = array();
$slease['ip'] = $static['ipaddr'];
$slease['act'] = "static";
- $slease['online'] = in_array(strtolower($slease['mac']), $arpdata_mac) ? 'online' : 'offline';
$slease['staticmap_array_index'] = $staticmap_array_index;
$leases[] = $slease;
$staticmap_array_index++;
OpenPOWER on IntegriCloud