Exemplo n.º 1
0
function updatePortForwarding($object_id, $localip_bin, $localport, $remoteip_bin, $remoteport, $proto, $description)
{
    return usePreparedUpdateBlade('IPv4NAT', array('description' => $description), array('object_id' => $object_id, 'localip' => ip4_bin2db($localip_bin), 'localport' => $localport, 'remoteip' => ip4_bin2db($remoteip_bin), 'remoteport' => $remoteport, 'proto' => $proto));
}
Exemplo n.º 2
0
function triggerIPAddressLog()
{
    $ip_bin = assertIPArg('ip');
    switch (strlen($ip_bin)) {
        case 4:
            $result = usePreparedSelectBlade("SELECT COUNT(id) FROM IPv4Log WHERE ip = ?", array(ip4_bin2db($ip_bin)));
            break;
        case 16:
            $result = usePreparedSelectBlade("SELECT COUNT(id) FROM IPv6Log WHERE ip = ?", array($ip_bin));
            break;
    }
    if ($row = $result->fetch(PDO::FETCH_NUM)) {
        if ($row[0] > 0) {
            return 'std';
        }
    }
    return '';
}