Skip to content
Oferta
Hosting
Poczta
Domeny
Serwery VPS
Tworzenie stron i sklepów internetowych
Outsourcing
Promocje
Narzędzia
Panel zarządzania
WebMail
Zarządzania bazami SQL
Pomoc
Hosting
Poczta
Domeny
Serwery VPS
O nas
Kontakt
if (isset($_GET['submit'])){ //-------------- // IPv4 class class ipv4 { var $address; var $netbits; //-------------- // Create new class function ipv4($address,$netbits) { $this->address = $address; $this->netbits = $netbits; } //-------------- // Return the IP address function address() { return ($this->address); } //-------------- // Return the netbits function netbits() { return ($this->netbits); } //-------------- // Return the netmask function netmask() { return (long2ip(ip2long("255.255.255.255") << (32-$this->netbits))); } //-------------- // Return the network that the address sits in function network() { return (long2ip((ip2long($this->address)) & (ip2long($this->netmask())))); } //-------------- // Return the broadcast that the address sits in function broadcast() { return (long2ip(ip2long($this->network()) | (~(ip2long($this->netmask()))))); } //-------------- // Return the inverse mask of the netmask function inverse() { return (long2ip(~(ip2long("255.255.255.255") << (32-$this->netbits)))); } } $adres=$_GET['adres']; $maska=$_GET['maska']; $ip_addr = $adres; $subnet_mask = (long2ip(ip2long("255.255.255.255")<< (32-$maska))); $ip = ip2long($ip_addr); $nm = ip2long($subnet_mask); $nw = ($ip & $nm); $bc = $nw | (~$nm); $ip = new ipv4($adres,$maska); echo "Adres IP: ".$ip->address(); echo "
Maska w bitach: ".$ip->netbits(); echo "
Maska: ".$ip->netmask(); echo "
Adres sieci: ".$ip->network(); echo "
Adres rozgłoszeniowy: ".$ip->broadcast(); echo "
Pierwszy host: ".long2ip($nw + 1); echo "
Ostatni host: ".long2ip($bc - 1); echo "
"; ?>
Powrót
} else { ?>
Adres IP:
Maska:
/0 aka 0.0.0.0
/1 aka 128.0.0.0
/2 aka 192.0.0.0
/3 aka 224.0.0.0
/4 aka 240.0.0.0
/5 aka 248.0.0.0
/6 aka 252.0.0.0
/7 aka 254.0.0.0
/8 aka 255.0.0.0
/9 aka 255.128.0.0
/10 aka 255.192.0.0
/11 aka 255.224.0.0
/12 aka 255.240.0.0
/13 aka 255.248.0.0
/14 aka 255.252.0.0
/15 aka 255.254.0.0
/16 aka 255.255.0.0
/17 aka 255.255.128.0
/18 aka 255.255.192.0
/19 aka 255.255.224.0
/20 aka 255.255.240.0
/21 aka 255.255.248.0
/22 aka 255.255.252.0
/23 aka 255.255.254.0
/24 aka 255.255.255.0
/25 aka 255.255.255.128
/26 aka 255.255.255.192
/27 aka 255.255.255.224
/28 aka 255.255.255.240
/29 aka 255.255.255.248
/30 aka 255.255.255.252
/31 aka 255.255.255.254
/32 aka 255.255.255.255
} ?>