Calculate broadcast address and network address from an IP address and netmask:
Calculate a netmask from the mask length:
Calculate the mask length from the netmask:
Determine if a host is on the same network with a second host:
Convert decimal IP address to hex: