add function checking if ip addr exists in a network