'Instantiate a new IPv4 network object.
Args:
address: A string or integer representing the IP [& network].
\'192.168.1.1/32\'
\'192.168.1.1/255.255.255.255\'
\'192.168.1.1/0.0.0.255\'
\'192.168.1.1\'
are all functionally the same in IPv4. That is to say,
failing to provide a subnetmask will create an object with
a mask of /32. A netmask of \'255.255.255.255\' is assumed
to be /32 and \'0.0.0.0\' is assumed to be /0, even though
other netmasks can be expressed both as host- and
net-masks. (255.0.0.0 == 0.255.255.255)
Additionally, an integer can be passed, so
IPv4Network(\'192.168.1.1\') == IPv4Network(3232235777).
or, more generally
IPv4Network(int(IPv4Network(\'192.168.1.1\'))) ==
IPv4Network(\'192.168.1.1\')
Raises:
IPv4IpValidationError: If ipaddr isn\'t a valid IPv4 address.
IPv4NetmaskValidationError: If the netmask isn\'t valid for
an IPv4 address.'

def __init__(self, address):

    BaseNet.__init__(self, address)
    BaseV4.__init__(self, address)
    if isinstance(address, (int, long)):
        self._ip = address
        self.ip = IPv4Address(self._ip)
        self._prefixlen = 32
        self.netmask = IPv4Address(self._ALL_ONES)
        if ((address < 0) or (address > self._ALL_ONES)):
            raise IPv4IpValidationError(address)
        return
    if _compat_has_real_bytes:
        if (isinstance(address, bytes) and (len(address) == 4)):
            self._ip = struct.unpack('!I', address)[0]
            self.ip = IPv4Address(self._ip)
            self._prefixlen = 32
            self.netmask = IPv4Address(self._ALL_ONES)
            return
    addr = str(address).split('/')
    if (len(addr) > 2):
        raise IPv4IpValidationError(address)
    if (not self._is_valid_ip(addr[0])):
        raise IPv4IpValidationError(addr[0])
    self._ip = self._ip_int_from_string(addr[0])
    self.ip = IPv4Address(self._ip)
    if (len(addr) == 2):
        mask = addr[1].split('.')
        if (len(mask) == 4):
            if (not self._is_valid_netmask(addr[1])):
                raise IPv4NetmaskValidationError(addr[1])
            if self._is_hostmask(addr[1]):
                self.netmask = IPv4Address((self._ip_int_from_string(addr[1]) ^ self._ALL_ONES))
            else:
                self.netmask = IPv4Address(self._ip_int_from_string(addr[1]))
            self._prefixlen = self._prefix_from_ip_int(int(self.netmask))
        else:
            if (not self._is_valid_netmask(addr[1])):
                raise IPv4NetmaskValidationError(addr[1])
            self._prefixlen = int(addr[1])
            self.netmask = IPv4Address(self._ip_int_from_prefix(self._prefixlen))
    else:
        self._prefixlen = 32
        self.netmask = IPv4Address(self._ip_int_from_prefix(self._prefixlen))
