예제 #1
0
def _pack_ip(ip_dot_str):
    """Convert an IP address string in dot notation to an 32-bit integer"""
    if not ip_dot_str:
        return None
    return struct.unpack('!L', inet_aton(str(ip_dot_str)))[0]
예제 #2
0
파일: authors.py 프로젝트: dbooth/mediacore
def _pack_ip(ip_dot_str):
    """Convert an IP address string in dot notation to an 32-bit integer"""
    if not ip_dot_str:
        return None
    return struct.unpack('!L', inet_aton(str(ip_dot_str)))[0]