IP
Shieldon\Firewall\Component\Ip
$ip = new \Shieldon\Firewall\Component\Ip();
$shieldon->setComponent($ip);
inRange($ip
, $range
)
- parametro
string
$ip -
IP da verificare nel formato IPV4 e IPV6
- parametro
mixed
$range -
Maschera di rete IP/CIDR
- ritorno bool
$result = $ip->inRange('123.22.33.44', '123.22.33.1/24');
// true
setAllowedItems($ips
)
- parametro
array
$ips -
Una collezione di indirizzi IP.
- ritorno
void
$ip = new \Shieldon\Firewall\Component\Ip();
$allowedIps = [
'123.22.33.44',
'88.22.33.55',
];
$ip->setAllowedItems($allowedIps);
$shieldon->setComponent($ip);
setAllowedItem($ip
)
- parametro
string
$ip -
Singolo indirizzo IP
- ritorno
void
$ip = new \Shieldon\Firewall\Component\Ip();
$ip->setAllowedItem('123.22.33.44');
$shieldon->setComponent($ip);
getAllowedItems()
$ip = new \Shieldon\Firewall\Component\Ip();
$list = $ip->getAllowedItems();
// ['123.22.33.44', '123.22.33.43', 'xxx.xxx.xxx.xxx']
setDeniedItems($ips
)
- parametro
array
$ips -
Array di IP.
- ritorno
void
$ip = new \Shieldon\Firewall\Component\Ip();
$deniedIps = [
'123.22.33.44',
'88.22.33.55',
];
$ip->setDenieddList($deniedIps);
$shieldon->setComponent($ip);
setDeniedItem($ip
)
- parametro
string
$ip -
Singolo indirizzo IP
- ritorno
void
$ip = new \Shieldon\Firewall\Component\Ip();
$ip->setDeniedItem('123.22.33.44');
$shieldon->setComponent($ip);
getDeniedItems()
$ip = new \Shieldon\Firewall\Component\Ip();
$list = $ip->getDeniedItems();
// ['123.22.33.44', '123.22.33.43', 'xxx.xxx.xxx.xxx']