<?php

namespace Buckhill\Net;

/**
 * @return array
 */
function getmacaddr()
{
    $mac = new MAC();

    return $mac->getMAC();
}

/**
 * @return array
 */
function getinterfaces()
{
    $net = new Network();

    return $net->getInterfaces();
}

/**
 * Checks if $addr parameter contains a MAC address that belongs to current computer
 *
 * @param array $addr
 * @return bool
 */
function hasMAC(array $addr)
{
    $macs = getmacaddr();

    $found = false;

    foreach($macs as $mac)
    {
        foreach($addr as $current)
        {
            if(0 === strcmp($current, $mac))
            {
                $found = true;

                break 2;
            }
        }
    }

    return $found;
}