import socket
import struct


def parse_ipv4(addr):
    """
    Return a numeric representation of the given IPv4 address.
    """
    binary_ip = socket.inet_pton(socket.AF_INET, addr)
    return struct.unpack('!L', binary_ip)[0]