Added functions for IP address validation.