aboutsummaryrefslogtreecommitdiffstats
path: root/packages/arpwatch_reports.php
diff options
context:
space:
mode:
authorColin Smith <colin@pfsense.org>2005-09-11 22:57:24 +0000
committerColin Smith <colin@pfsense.org>2005-09-11 22:57:24 +0000
commit10de8a046aa8ac3a2b2fe1e26743861d635b50b4 (patch)
tree7b1fd47132ae87d339c7b558498a83b91bbf54ee /packages/arpwatch_reports.php
parenta9cbef76993f933efb6564aa1b3f62b419261146 (diff)
downloadpfsense-packages-10de8a046aa8ac3a2b2fe1e26743861d635b50b4.tar.gz
pfsense-packages-10de8a046aa8ac3a2b2fe1e26743861d635b50b4.tar.bz2
pfsense-packages-10de8a046aa8ac3a2b2fe1e26743861d635b50b4.zip
Pad MACs with leading zeros.
Diffstat (limited to 'packages/arpwatch_reports.php')
-rwxr-xr-xpackages/arpwatch_reports.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/arpwatch_reports.php b/packages/arpwatch_reports.php
index b39fb9fb..1bdb5233 100755
--- a/packages/arpwatch_reports.php
+++ b/packages/arpwatch_reports.php
@@ -44,11 +44,15 @@ if(file_exists($logfile)) {
$rawrep = file($logfile);
foreach($rawrep as $line) {
$todo = preg_split('/\s/', $line);
+ $rawmac = explode(":", trim($todo[0]));
+ foreach($rawmac as $set) $mac[] = str_pad($set, 2, "0", STR_PAD_LEFT);
+ $newmac = implode(":", $mac);
$report[$todo[1]][] = array(
- "mac" => trim($todo[0]),
+ "mac" => $newmac,
"timestamp" => trim($todo[2]),
"hostname" => trim($todo[3]) ? trim($todo[3]) : "Unknown"
);
+ unset($mac);
}
}
$pgtitle = "arpwatch: Reports";