import socket
import struct


def inet_aton(addr):
    """Convert an IP addr in IPv4 dot notation into an int.

    addr    IP address as a string

    returns integer
    """
    b = socket.inet_aton(addr)
    return struct.unpack('!I', b)[0]