added ipv4 support and separated ipv4 & ipv6