added ipv4/ipv6 support in foreign parts