Added ipv6 support

replaced AF_INET with AF_INET6 and inet_aton with AF_INET6